Jump to content

Help with tar


Guest edfinegan
 Share

Recommended Posts

Guest edfinegan

I created a backup script that uses tar. However i want to make it so that tar creats archives that will fit on to a CD looked in to useing the -M option with tar but this always requires user intervention. Is there a way to make tar, tar up a 2GB directory in 650 MB parts with out any need for a user once the script has started.

 

Thanks

Ed

Link to comment
Share on other sites

Guest edfinegan

Yeah the 2GB limit is my problem. What is this limit anyway, is it built in to the kernal or is it a filesyststem thing. I'm using the 2.2 kernal and ext2. Anyway does anyone know of a different way to do this, maybe via cpio. I'm going to look into the gfslicer program but i think that will also fail at 2GB.

 

Ed

Link to comment
Share on other sites

2 gb is a limitations of ext2 .... ReiserFS can go upto 12 gb (I thinK) and I don't know what ext3 can do.

it got to do with blocksize's of node on your filesystem

 

Not sure I understand this... I have a 20Gb ext3 partition to which I dump tar.gz backups of the 27Gb ext3 /home partition (I use two different harddrives). The files are about 2.5Gb each, and I think they are perfectly OK (well, I checked them before they exceeded 2GB).

 

So, what implication does the above limitation imply? Is this the reason why the gfslicer does not work on them?

Link to comment
Share on other sites

Did you try that?

tar cf - what you want to archive | split --bytes 650m - archivename.tar

or

tar czf - what you want to archive | split --bytes 650m - archivename.tar.gz

or

tar cjf - what you want to archive | split --bytes 650m - archivename.tar.bz2

Yves.

Link to comment
Share on other sites

Thanks, Yves.

 

How do you now merge several tar.gzXX archives into one tar.gz file? Say, I tried this:

$ tar czf - Testdir | split --bytes 650m - test.tar.gz

$ mv test.tar.gzaa test.tar.gz

$ tar tzvf test.tar.gz

and got these messages along with the content of the archive

gzip: stdin: decompression OK, trailing garbage ignored

tar: Child returned status 2

tar: Error exit delayed from previous errors

What trailing garbage? Is the archive screwed up?

 

Cheers,

Val.

Link to comment
Share on other sites

Thanks, Yves.

 

How do you now merge several tar.gzXX archives into one tar.gz file?

$ tar czf - Testdir | split --bytes 650m - test.tar.gz

Val.

You wrote a name on the command line, here: test.tar.gz

Normally, all created files should be named the same, with an additional 2-digit number, eg: test.tar.gz00 test.tar.gz01 ... (or with letters aa ab ac... it's the same)

Put all those files test.tar.gzXX together in the same directory TARDIR and cd to the place you want the backup to be restored.

Do this:

cat TARDIR/test.tar.gz* | tar xzpf -

Yves.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...