Hello, I'm trying to do backups with rsync through ssh. This is what I wrote yet: src="/vrmd/webserver/" today=`date +%F` #link_dest="root@vm2:/vrmd/admin/backup/web/2004-09-05" link_dest="../2004-09-05" dest="root@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? Regards Marten
On Mon 06 Sep 2004, Marten Lehmann wrote:> > src="/vrmd/webserver/" > today=`date +%F` > #link_dest="root@vm2:/vrmd/admin/backup/web/2004-09-05" > link_dest="../2004-09-05" > dest="root@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
On Mon, Sep 06, 2004 at 08:30:24PM +0200, Marten Lehmann wrote:> 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.Yes, you thought correctly.> Is --link-dest thought to work with a host:path parameter?No, --link-dest always applies to the receiving system, so there's no need for a host: prefix. Just specify the path where it should hard-link the files (and make sure that it's on the same partition as the destination files, or the hard-links can't be created).> link_dest="../2004-09-05"A relative path might move around if you ever specify more than one source dir, so I prefer to use an absolute path for --link-dest, e.g.: --link_dest=/vrmd/admin/backup/web/2004-09-05 ..wayne..