Rsync snapshots / rolling backups

Today I had the task of updating my backup system, for a long time I didn’t bother rolling backups because, well I just didn’t care. However I now wanted to set something up. I remembered long ago that I had done this before, based on the excellent, albeit dated write up from Mike Rubel. After some hacking I rewrote his script to make it a bit more useful in my environment. The script now accepts a single argument, which points to a configuration file. To download the initial version of this tool I called ‘snapshots’ click on the link below.

snapshots.tar.gz

Bash: internal time command successful redirect

So today I was struggling with `time’ trying to get it to redirect. Basically what I wanted to do was time the output of a file, then pipe both timing and file output to gzip for compression.

After struggling with various suggestions I finally found one that worked:

{ { time date; } 2>&1; } | gzip - > output.gz

or less efficiently:

(( time date; ) 2>&1 ) | gzip -> output.gz