5

I have incremental rsync backups of a folder, created with:

rsync --delete -a -v --backup --backup-dir="../backup_`date +%Y-%m-%d`" /orig /backups/dest

so I have a copy of current /orig on /backups/dest and modified files on /backups/backup_YYYY_MM_DD/

my question is there's any easy way to restore the backup as it was on specific date?

Lluís
  • 435

2 Answers2

3

As the various backup dirs only contain the changed files by the last current backup, the restore procedure is somewhat complex: you need to restore the current full backup and re-apply the various file-level backup, up to the required (past) date.

Can I suggest you a better backup method? Please use the --link-dest option combined with proper rotation.

Even better, give a look at rsnapshot and its doc

shodanshok
  • 52,255
0

I think:

rsync -a --delete /backups/backup_YYYY__MM__DD/orig/ /orig/

should suffice.

Take care of the trailing slash at the end of the source directory pathname.

HTH

phep
  • 424