Skip to content

Instantly share code, notes, and snippets.

@jackkamm
Created February 2, 2019 23:42
Show Gist options
  • Save jackkamm/46abeea37bd2bf622519f6729c27d61d to your computer and use it in GitHub Desktop.
Save jackkamm/46abeea37bd2bf622519f6729c27d61d to your computer and use it in GitHub Desktop.
backup $HOME
# This is a simple script to backup, compress, and encrypt $HOME
set +e
# set recipient for encryption
RECIPIENT="jackkamm@gmail.com"
# To improve I/O, keep $DEST on local filesystem,
# and copy it to external medium afterwards
DEST=/var/tmp/backup_home.tar
# $DEST assumed to be outside $HOME; otherwise "tar --exclude" it
tar -cf $DEST -C $HOME .
pigz $DEST
gpg --recipient $RECIPIENT --encrypt $DEST.gz
rm $DEST.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment