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.

Merge and burst PDFs with nautilus-actions

Two scripts, one for merging and one for bursting (splitting up into single pages). Grab them here.

They output to the directory the PDFs are in. The merge script collates the PDFs in alphabetical order and outputs to 'merged.pdf', the burst script numbers the pages.

Add it to nautilus-actions the normal way, with %M as the parameter and to only show when *.pdf is displayed, obviously.

These scripts rely on pdftk to do the work.