Compress files and encrypt them
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.