problems with --link-dest

Paul Slootman paul at
Tue Sep 7 08:26:02 GMT 2004

On Mon 06 Sep 2004, Marten Lehmann wrote:
> src="/vrmd/webserver/"
> today=`date +%F`
> #link_dest="root at vm2:/vrmd/admin/backup/web/2004-09-05"
> link_dest="../2004-09-05"
> dest="root at vm2:/vrmd/admin/backup/web/$today"
> rsync -av -e ssh --delete --link-dest=$link_dest $src $dest
> in 2004-09-05 (on the dest-server) is the directory with the backup from 
> yesterday. Of course, I only want changed files to be copied. I thought 
> that link-dest is the right thing for this, so that each file from 
> /vrmd/webserver is either hardlinked to the already backuped file in 
> 2004-09-05 or it will be copied to 2004-09-06. But as it seems, 
> link-dest doesn't work through ssh (or remote in general?) but only at 
> local systems. I don't have enough space for local backups, there's also 
> no possiblity to add another drive in a 1HE 19" server and I can't mount 
> in an NFS-device, because this doesn't work through the firewall. Is 
> --link-dest thought to work with a host:path parameter?

You're trying to make a sort of snapshot per day, where common files
across days are hardlinked?

Try this:
    rsync -av -e ssh --delete --link-dest=$link_dest --compare-dest=$link_dest $src $dest

i.e. add the --compare-dest option...

I use this daily to backup to an archive of 1.4TB (retaining 3-6 days
from about 120 systems).
Only difference is that I initiate the rsync from the backup server,
instead of to it. That way the backup server is guaranteed to have only
one rsync session running at a time, which is useful because this (here)
is quite disk-intensive, and having more than one simultaneous rsync
session would cause disk thrashing.

Paul Slootman

More information about the rsync mailing list