Saturday, August 3, 2013

HOWTO tar, zip, and encrypt a directory tree

Use this command to tar, zip and encrypt a directory:
tar cvz --to-stdout src_dir | gpg --cipher-algo AES256 --symmetric > out.tar.gz.gpg
OR you can use gpg-zip, which is a thin shell wrapper around tar and gpg for exactly this purpose, but it turns out getting the arguments passed correctly to tar and gpg for what I want to do was more complex than the above.

No comments: