Skip to content

Instantly share code, notes, and snippets.

@sergejx
Created January 20, 2010 13:10
Show Gist options
  • Save sergejx/281827 to your computer and use it in GitHub Desktop.
Save sergejx/281827 to your computer and use it in GitHub Desktop.
Simple backups using rsync
#!/bin/sh
# Simple backups based on article
# http://blog.interlinked.org/tutorials/rsync_time_machine.html
FILES=$HOME # What to backup
BACKUPS=/media/sklad/backups-`uname -n` # Where to store backups
# File .rsync-filter can be used to exclude/include some files
# Use `man 1 rsync` for more information
date=`date "+%Y-%m-%dT%H:%M:%S"`
rsync -aPF --link-dest=$BACKUPS/current $FILES $BACKUPS/back-$date
rm $BACKUPS/current
ln -s back-$date $BACKUPS/current
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment