Guest edfinegan Posted February 11, 2003 Report Share Posted February 11, 2003 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 Quote Link to comment Share on other sites More sharing options...
coverup Posted February 11, 2003 Report Share Posted February 11, 2003 I had the very same question a while ago. Couldn't come up to anything better than simply cutting the tarball to chunks of 650MB. This might work: http://www.geocities.com/gfslicer though I still have problems with tarbolls that are larger than 2GB. Quote Link to comment Share on other sites More sharing options...
Guest edfinegan Posted February 11, 2003 Report Share Posted February 11, 2003 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 Quote Link to comment Share on other sites More sharing options...
paul Posted February 12, 2003 Report Share Posted February 12, 2003 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 Quote Link to comment Share on other sites More sharing options...
coverup Posted February 12, 2003 Report Share Posted February 12, 2003 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? Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted February 12, 2003 Report Share Posted February 12, 2003 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. Quote Link to comment Share on other sites More sharing options...
coverup Posted February 12, 2003 Report Share Posted February 12, 2003 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. Quote Link to comment Share on other sites More sharing options...
ramfree17 Posted February 13, 2003 Report Share Posted February 13, 2003 if im not mistaken you can just append the files using cat, something like (do this on a backup copy) $ cat [second tar] >> [first tar] . look at my sig. :#: ciao! Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted February 13, 2003 Report Share Posted February 13, 2003 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. Quote Link to comment Share on other sites More sharing options...
coverup Posted February 13, 2003 Report Share Posted February 13, 2003 Thanks, Yves and ramfree17. cat TARDIR/test.tar.gz* | tar xzpf - I'll give it a go tomorrow. Split did create test.tar.gzaa. I renamed it back to test.tar.gz. I guess, I shouldn't. Cheers. Val. Quote Link to comment Share on other sites More sharing options...
Guest edfinegan Posted February 13, 2003 Report Share Posted February 13, 2003 I just want to thank everyone who helped me out. I got a chance to play with split today and that is exactly what i was looking for. Ed Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.