Click to See Complete Forum and Search --> : rsync --delete questions


TheSpeedoBeast
07-23-2007, 01:25 PM
I am in the midst of setting up a file server and a rsync backup server for that file server. (For security's sake). Now, I understand with rsync, if you run it with the --delete flag, it will delete any files that were removed from the source folder from the archive, also. My question is if there is any way to delay the delete from the archive. Say, if I mistakenly deleted foo.wav from my source, it would take a long time (say, a month) for foo.wav to be removed from the backup archive. This way, I will get a grace period to realize that foo.wav was deleted from my source, and can recover it from the backup, because the backup of foo.wav wasn't deleted immediately. Let me know if you have any ideas. Thanks all.

folkert
07-23-2007, 02:25 PM
You might want to look here: http://www.sanitarium.net/golug/rsync_backups.html
or read about the flags --backup and --backup-dir=/where/the/deleted/and/chanced/files/go

If you use both the flags and cp -al like explained in the link, it still requires hardly more space than all your files+the different versions all just once

DrChuck
07-23-2007, 03:19 PM
If you do a dry run of rsync, with rsync -av --dry-run --delete, the console output lists the files which satisfy the delete criteria, without actually deleting anyhing. You will need to do a little scripting to parse that output into a list of obsolete files. After doing your backup without the --delete flag, you can then move everything in the list to a separate directory on your backup directory. Delete those files manually at your discretion.

TheSpeedoBeast
07-23-2007, 03:59 PM
Hmm, that's not a bad idea... sort of a 'Recycle Bin' for your backups. Remove them and they get moved to the recycle bin instead of getting torched. Anyone else have any other ideas for this sort of thing?