Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.