Skip to content

Instantly share code, notes, and snippets.

@jyc
Created February 9, 2013 05:49
Show Gist options
  • Select an option

  • Save jyc/4744090 to your computer and use it in GitHub Desktop.

Select an option

Save jyc/4744090 to your computer and use it in GitHub Desktop.
#!/bin/zsh
KEYFILE="/home/jonathan/tarsnap.key"
NAME="backup-`date +%s-%Y:%m:%d-%H:%m`"
CACHEDIR="/home/jonathan/.tarsnap-cache"
tarsnap --keyfile $KEYFILE --cachedir $CACHEDIR \
--exclude /proc/ --exclude /sys/ --exclude /dev/ --exclude /run/ \
--exclude /root/ \
--exclude /tmp/ --exclude /mnt/ --exclude /media/ --exclude /lost+found \
--exclude /var/lib/pacman/sync/ \
--exclude /home/jonathan/Downloads --exclude $CACHEDIR \
--exclude /home/jonathan/Dropbox \
-cf $NAME / # the directory to backup (/)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment