We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now


Encrypting contents of bzipped tarballs

Frybread asked
Medium Priority
Last Modified: 2010-04-22
I have a crude backup system for our office network consisting of a bash script that runs nightly at 3 AM, makes bzipped tarballs of some major directories and their sub-directories, and then creates a new folder to store these bzipped tarballs.

Once or twice a month on a Friday afternoon, I'll SSH into the server and create .iso files containing these bzipped tarballs and burn them to CD's.

Anyone with the smallest amount of computer knowledge could easily figure out how to unpack and view all this data if they got hold of any of these CD's.

How do I go about encrypting all this data prior to the tarballing and bzipping?
Can I work some encryption commands into my bash script that will do this for me?
What should I read up about in order to accomplish the creation of encrypted bzipped tarballs.

Thanks for you time and help.

Watch Question

Top Expert 2005
You could do such chain:
tar the data, then encrypt it (with gpg), then bzip2 it.
tar [options] | gpg -c | bzip2 > output.encrypted.tar.bz2

or use zip or rar for that purpose (instead tar/bzip2)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.