Backing up rsnapshot directory with rsync copies entires backup directory

backuprsnapshotrsync

I have a main backup server running rsnapshot, with ~2TB of backups stored on it. After the nightly backups, I copy the contents of the rsnapshot directory to an offsite server, using rsync -aH --delete /source /dest. However, this seems to copy the entire contents of the backup directory every night, as the offsite copy takes ~9 hours to complete.

I assume my rsync command doesn't have the right switches, but there may be something else I'm missing. Any ideas?

Best Answer

The issue here is that if you want to keep a copy of the whole versioned backup on a remote location, you're going to have to handle the fact that rsnapshot rotates the directory names whenever it runs, so you'll end up with a fresh copy of the most recent backup being copied over every time.

You can alter the way rsnapshot runs in terms of when it performs the copies and when it rotates (renames) the directories and you can also execute scripts at various points in rsnapshots execution cycle, like before or after a specific backup point is run.

There's a helpful post here:

https://stackoverflow.com/questions/10691522/mirror-rsnapshot-backup-directory

Another approach is to get a copy of rsnapshot on your second machine and have it backup the contents of /snapshot_root/daily.0 AFTER your main back has been completed. This, in conjunction with the correct rsync flags will give you an incremental copy of your latest backups.

Related Topic