Symlinks in source path with --relative

Matt McCutchen matt at
Wed Aug 13 13:49:31 GMT 2008

On Wed, 2008-08-13 at 13:01 +0100, Phil Endecott wrote:
> 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.

Upgrade the sending rsync to 3.0.0 or newer (which always sends
ancestors of a source argument as directories, not symlinks, with
--relative) or pass --no-implied-dirs to avoid processing the ancestors
of home/phil/important at all.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
Url :

More information about the rsync mailing list