Saturday 10 July 2010

Short term 'back in time' snapshots




If files stand a chance of getting corrupted (such as openoffice documents), or you run the risk of hacking away and accidentally breaking one part of your code, it can be nice to have a 'back in time' feature. This script is intended for short term snapshots. Add it to your nautilus-actions or whatever, and select the files or folders you want snapshots of and the time in minutes between each snapshot. 

It uses rsync to create a backup folder every x minutes containing your selected file(s), and 'cp -al' to create hardlinks to prior versions to keep disk space low. This means it'll only save new copies of the bits that change, but give you all available data for any given snapshot)

Perhaps ill create a GUI for it at some point, but for now its CLI only, so if you add it to nautilus-actions, make sure you specify that it's to be launched with a terminal, eg:
gnome-terminal -x python ~/scripts/short_term_sync.py

Click here to grab it, and don't forget to edit the 'dest', around line 27.

No comments:

Post a Comment