Create a tar and splitting it into multiple archives then putting them back together

0

2

I am using the following for creating the tgz files:

tar zcf - /usr/folder | split -b 30720m - /usr/archive.tgz

Now I get three files: archive.tgzaa, archive.tgzab and archive.tgzac

So again I want to assemble those three archives into one tgz file...

cat archive.tgza* | (tar x)
tar: Archive is compressed. Use -z option
tar: Error is not recoverable: exiting now

Then i did:

cat archive.tgza* | (tar z)
tar: You must specify one of the `-Acdtrux' options
Try `tar --help' or `tar --usage' for more information.

And then finally:

cat archive.tgza* | (tar xz)

worked but it started unpacking the archive... How can I simply join it back into one archive ?

Thanks !

user130145

Posted 2012-04-25T07:25:36.010

Reputation: 3

Answers

6

Leave off the tar part entirely.

cat archive.tgza* > archive.tgz

geekosaur

Posted 2012-04-25T07:25:36.010

Reputation: 10 195

perfect ! fast and efficient answer ! thanks ! – user130145 – 2012-04-26T14:06:57.560