Skip to content

Instantly share code, notes, and snippets.

@NiklasMM
Last active December 26, 2015 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NiklasMM/7115008 to your computer and use it in GitHub Desktop.
Save NiklasMM/7115008 to your computer and use it in GitHub Desktop.
A script I use to store encrypted backups of my files on dropbox
#!/bin/bash
DATE=$(date +%d.%m.%y-%H.%M)
# the unencrypted tar file
FILE=${DATE}Uhr.tar.gz
tar -czf ${FILE} -T .files_to_archive
# the encrypted tar file
ENCFILE=${FILE}.crypt
gpg -c -o ${ENCFILE} ${FILE}
# move encrypted archive to Dropbox
mv ${ENCFILE} Dropbox/backups
# delete original archive
rm ${FILE}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment