Piping tar into gpg

Michel Messerschmidt lists at michel-messerschmidt.de
Fri Feb 22 20:59:16 CET 2013

On Wed, Feb 20, 2013 at 10:29:08PM +0100, Stefan Malte Schumacher wrote:
> "find /mnt/raid/Dokumente/ -type f -print0 |tar cfzv | gpg --symmetric
> --output 1.tar.gz.gpg" aks for a password but aborts after creating a 4,0K
> large binary file. I have had other cases in which tar and gpg were
> obviously working (I monitored the program activity with htop) but instead
> of writing to the file specified with --output they were overwriting a
> random file in the path selected with find. 

Are you sure that gpg overwrote the files? 
Piping into "tar cfzv" would write *to* the first file found due to 
the "f" option.

Another thing is that you don't need find if you just want to put 
everything below a directory in a tar file. You could use:
cd /mnt/raid/Dokumente/
tar --create . | gpg --symmetric --output $DESTINATION/1.tar.gpg

But if you really want to exclude other filetypes, you better stick 
to find.

More information about the Gnupg-users mailing list