Skip to content

Instantly share code, notes, and snippets.

@arobb
Created November 26, 2019 00:32
Show Gist options
  • Save arobb/eca1f1ffd9fbdbe0230915c204cad929 to your computer and use it in GitHub Desktop.
Save arobb/eca1f1ffd9fbdbe0230915c204cad929 to your computer and use it in GitHub Desktop.
Quick tar and encrypt
# Include files that have been symlinked
tar -czf backup.tar.gz --dereference ./backup
gpg --armor --output backup.tar.gz.gpg --symmetric --cipher-algo AES256 backup.tar.gz
# Decrypt for a bunch of files
read -s -p "Enter Password: " pw
echo -ne "\033[0K\r"
echo "$pw" | gpg --batch --passphrase-fd 0 --output backup.tar.gz --decrypt backup.tar.gz.gpg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment