Using rsync as an incremental backup

Henri Shustak henri.shustak at
Sun Jun 26 06:20:13 MDT 2011

> I'm using rsync to do an incremental backup of my desktop here, to a
> remote server as follows:
> #/usr/bin/bash
> old=$(date -d 'now - 1 week' +%Y-%m-%d)
> new=$(date +%Y-%m-%d)
> rsync -avP --delete --link-dest=../$dir /home/bakers
> bakers at$new/
> This is actually working GREAT! The only problem is that sometimes the
> cronjob won't complete (internet is down, something like that). When it
> tries to run the next week it does --link-dest against a dir that
> doesn't exist. It happily complies and transfers EVERY file because
> there is no source to hardlink from.
> I'd really like rsync to exit and throw an error if the --link-dest
> isn't present. I can't find anything in the man page about any fancy
> --list-dest options. Am I missing it?

Hopefully, Scott's suggestion will solve this issue for you.

You may also be interested in the way LBackup works for hard-linked incremental backups. It uses a numbering system rather than a date system. 

If you still want to have the date named entries within the file system, it is just a matter of enabling a post-action which keeps a date-named symbolic links directory to these backup snapshots up to date.

Details on the LBackup post and pre actions are available from the following URLs :

  - (basic intro on LBackup pre/post actions)
  - (source code for the example post action script mentioned) 

This is all just another way of approaching this issue which you may find of interest. The one issue is that the script (source code link above) will need to be run on a system which has access to the file system which stores the snapshots. It would require modification if you wanted to run it on a remote system.

Hope this helps :^)

This email is protected by LBackup, an open source backup solution.

More information about the rsync mailing list