Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create an encrypted tar but also I want to have a log of what tar has compressed, I'm using the following command:

tar -cvvf - --files-from=/root/backup.cfg | openssl des3 -salt -k backuppass | dd of=/root/tmp/back.encrypted

But I need to have a log of tar's stdout. I don't know how to get it, because If I use ">" in tar command openssl result is not correct.

I've also checked tar manual hoping to find some option to write stdout to a file, but I have found nothing.

any help?

thanks & Regards.

share|improve this question
btw. the pipe to dd is unnecessary. You can just direct stdout to a file > /root/tmp/back.encrypted – AndreasT Nov 23 '12 at 9:40
up vote 3 down vote accepted

Thx for this question, I didn't know how tar behaves in that situation. It seems to me, that in case the archive is stdout, tar outputs all other information on stderr. So here you go for logging to backup-tar.log:

tar -cvvf - --files-from=/root/backup.cfg 2>backup-tar.log | openssl des3 -salt -k backuppass | dd of=/root/tmp/back.encrypted
share|improve this answer
thanks! thats what I need, but there is a parameter that is also useful "--totals". This parameters let me see the total size: Total bytes written: 22732800 (22MiB, 17MiB/s) – magiza83 Nov 23 '12 at 10:41

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.