Compress files and encrypt them
This article was last edited over 3 years ago. Information here may no longer be accurate. Please proceed with caution, and feel free to contact me.
Compress and “zip” (or “tar”) multiple files and encrypt the compressed output.
tar \
--gzip \
--absolute-names \
--create \
"${HOME}/.some/directory" \
"${HOME}/other/directory" \
| gpg \
--batch --yes \
--symmetric \
--output ./data.tar.gz
The file can be decrypted like so.
gpg \
--output ./decrypted.tar.gz \
--decrypt ./data.tar.gz
Feel free to contact me with questions or feedback regarding this
article.