Symlinks in source path with --relative

Phil Endecott spam_from_rsync at chezphil.org
Wed Aug 13 12:01:43 GMT 2008


Dear Experts,

I have a fairly straightforward backup script that does something like this:

cd /
rsync -a --delete --relative home/phil/important backupserver:/backup/foo/

This was working fine and, for example, /home/phil/important/file1 was 
copied to /backup/foo/home/phil/important/file1 on the backup server.

But then I changed the disk partition arrangement on the source 
machine.  Before, /home was a filesystem; now there's a filesystem 
called /data, and /home is a symlink to /data/home:

ls -l /
...
drwxr-xr-x  6 root root   4096 Oct  9  2007 data
lrwxrwxrwx  1 root root     10 Nov 21  2006 home -> data/home/
...

Now, it seems that rsync notices this symlink and tries to recreate it 
on the backup server because of the -l implied by -a.  This is not what 
I want.  However, I do want any symlinks inside /home/phil/important to 
be copied as links, so I can't simply drop the -l.

I note that there are various options related to symlinks, but as far 
as I can see none of them does what I want.  Have I missed something?

Note that "cp --parents -a" seems to have the behaviour that I want.


Thanks for any suggestions,

Phil.






More information about the rsync mailing list