You are not logged in.

#1 2014-08-26 09:50:01

pentago
Member
From: Serbia
Registered: 2013-10-31
Posts: 29
Website

[SOLVED] Issues with gzip and gpg archives

I'm using tar+gpg to automate encrypted backups creation and making those works fine but restoring bothers me a bit.

I create these with:

tar -czf - /home/user/.packages | gpg -e -r user -o packages.tgz.enc

When i try to decrypt/restore these with:

gpg -o packages.tgz -d packages.tgz.enc | tar xzf -

I get:

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now

But archives decrypted and decompressed just fine.
Not sure what's the deal as this works just fine on FreeBSD.

Any suggestions?

Last edited by pentago (2014-08-26 11:57:06)

Offline

#2 2014-08-26 11:18:42

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: [SOLVED] Issues with gzip and gpg archives

gpg isn't writing to stdout in your pipeline. Rather, you're explicitly telling it to write to a file on disk with the -o flag. So, tar has nothing to read from stdin.

Offline

#3 2014-08-26 11:56:53

pentago
Member
From: Serbia
Registered: 2013-10-31
Posts: 29
Website

Re: [SOLVED] Issues with gzip and gpg archives

You're right.

It should've been:
gpg -d packages.tgz.enc | tar -xzf -

Blindness.


Thanks

Offline

Board footer

Powered by FluxBB