Tomasz Chmielewski
2005-Jun-27 14:06 UTC
include/exclude - how to transfer /etc and /home/users from /?
I'm trying to copy recursively only /etc, /home/samba/profiles and /home/samba/shared. To do so, I use this rsync command: rsync --progress -v -u -a -z --stats \ --include="/etc" \ --include="/home/samba/profiles" \ --include="/home/samba/shared" \ --exclude="/*" \ --numeric-ids --delete-after -e ssh backup@CON:/ \ /home/samba/linuxbackup/latest/CON/ Unfortunately, it copies only /etc, it doesn't touch /home/samba/... directories I specified. What am I doing wrong? I spent an hour looking through include/exclude problems on this list, but I still can't figure out how can I transfer these three folders. Note that I don't want to use a include/exclude file, as these all values are sitting in a script, and creating an additional file wouldn't be very handy. Anyone? -- Tomek
Wayne Davison
2005-Jun-27 16:33 UTC
include/exclude - how to transfer /etc and /home/users from /?
On Mon, Jun 27, 2005 at 04:05:47PM +0200, Tomasz Chmielewski wrote:> I'm trying to copy recursively only /etc, /home/samba/profiles and > /home/samba/shared.The manpage explains how you need to include all directories on the way down to the file/dir in the recursive descent. Or just use --files-from and it is usually much easier than trying to get the include/exclude rules right. Some examples of both the include/exclude syntax and the --files-from syntax are in this recent email on the subject: http://lists.samba.org/archive/rsync/2005-June/012846.html ..wayne..