This is the old XigmaNAS forum in read only mode,
it will taken offline by the end of march 2021!



I like to aks Users and Admins to rewrite/take over important post from here into the new fresh main forum!
Its not possible for us to export from here and import it to the main forum!

rsync not creating all subdirectories

Synchronize files & directories to/from XigmaNAS with minimal data transfer.
Forum rules
Set-Up GuideFAQsForum Rules
Post Reply
xyzijk
NewUser
NewUser
Posts: 2
Joined: 03 Dec 2016 05:18
Status: Offline

rsync not creating all subdirectories

Post by xyzijk »

I have the following rsync line in a Linux system:

rsync --delete -avhx --filter="- Cache" --files-from=- / /HardDrive/B.1 >> /tmp/B1.log <<- EOI
/home/xyz/.mozilla/
/home/xyz/bin/
/home/xyz/.thunderbird/
/etc/hosts
/etc/fstab
/etc/rc.d/
EOI

On executing this, the directories and files specified in stdin are copied to /HardDrive/B.1, with B.1 being created as needed. However, not all subdirectories are copied. For example, under /home/xyz/.thunderbird I have the following directories:

Crash\ Reports
default.md0
appreg
profiles.ini

The first two are directories, the last two are files.

The files are copied correctly. However, the directories are empty, despite of the fact that the original directories contain numerous files (and subdirectories.)

Why is rsync not copying those entries? It is not a permissions problem, for the command is executed by root. Also, it is not a problem peculiar to this specific directory - it happens to the other entries in stdin. Anybody have any suggestions on how to fix this issue?

xyzijk
NewUser
NewUser
Posts: 2
Joined: 03 Dec 2016 05:18
Status: Offline

Re: rsync not creating all subdirectories

Post by xyzijk »

I have just learned that when using --files-from, the -a option does not imply recursion - i.e. one has to add the -r option explicitly.

Post Reply

Return to “RSYNC”