On Wed, 2004-09-22 at 14:55, hugenots wrote: > welcome newbie, > > can someone sugest nice script for making tar arcives with given > size from given folder, presuming that data in folder is more than > given volume size; that volumes must be independet form each other > (no file spliting); that volume name is "smart" (e.g. vol1.tar; > vol2.tar vol3.tar; ...) > > maybe I'm thinking in the wrong direction, then please enlighten me > :) > > the idea is to make tar arcives for storing to dvd, except storing > will be done once in a month, but archiving should be perfomed more > or less every night. so there will be hard copy and daily backup.
My suggestion is to use rar. With rar, you can do multivolume archives, fully compressed, into whatever size you need. I picked a size number (exactly 36700000 bytes) that would allow me to exactly fill up 700 meg CD's with little or no slack space left over. There is about 2 meg or so slack space left over after you put 20 volumes on the CD. You could just as easily pick a size that would fit exactly to the 4.7 gig size of a DVD. Rar also allows you to put "recovery data" in with the archives. These contain data that can be used to reconstruct a damaged multivolume archive section. So if something happens to your backup media and archive volume number 365 happens to be damaged or incomplete, the recovery volumes (across ALL of the volumes) use their information to reconstruct that particular volume. The rar command line I use to archive: rar a -mdG -r -rr -ol -cl -av- -m5 -v36700000b archive_name source_files "a" is a rar "command" and instructs it to create an archive. -mdG increases the table of contents to max for large numbers of files. -r instructs rar to be recursive, and descend into subdirectories. -rr instructs rar to put recovery information in every single archive. -ol Important. Tells rar to save symbolic links as a file rather than to follow them. -cl possibly not needed, but I use it to archive windows partitions; converts all filenames to lower case. Use judiciously and as needed. -av- disables volume authentication, which is not available in the free version of rar anyhow. Omitting this may cause non-critical errors whenever you access the archives. -m5 Maximum compression. Unbeatable by any other compression utility in Linux. Adjust downward if you want faster archiving. Maximum compression gives you the absolute most data per CD, but it takes alot of time to create; you may want to sacrifice compression for speed. Extraction from archives does not seem to be affected by the initial compression level. One reason I like multivolume archives, if you don't already know this, is because of recovery information as well as "risk distribution". Big files that take up a whole CD are a "bad thing"(tm). You lose the file, you lose the whole archive. It's much better to split the whole storage up into recoverable handleable pieces. That way if you lose a piece, you don't lose the whole thing. Large CD-sized archives are a disaster waiting to happen. One bad spot on the CD and your data is toast. Not so with multivolume archives. You lose one archive, you still have a prayer of recovering the lost piece. The more mulitvolumes you have, the more the risk is distributed. 20 archives per cd is a number I chose, however the number of archives per cd could be 30 or 40, if you greatly value your data. The risk of loss is distributed more as you increase the number of archives. With tar, you cannot do multivolume archives unless you are writing to removable media that can be changed out. That normally doesn't happen these days for the normal user. I write to free space on the hard drive first, then burn the result to CD. Also, with tar or gzip, you can forget recovery capabilities. Not happening. With rar the compression is superior, multivolume archiving is possible, recovery information per volume is possible, and if your cd gets damaged you still have the chance of reconstructing volumes. Example archive cd listing: [EMAIL PROTECTED] elx]$ ll /mnt/cdrom2 total 711500 -r-xr-xr-x 1 root root 36700000 Jan 18 10:24 bg2.part001.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:26 bg2.part002.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:28 bg2.part003.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:30 bg2.part004.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:32 bg2.part005.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:34 bg2.part006.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:36 bg2.part007.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:37 bg2.part008.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:40 bg2.part009.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:42 bg2.part010.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:44 bg2.part011.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:46 bg2.part012.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:49 bg2.part013.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:50 bg2.part014.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:53 bg2.part015.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:55 bg2.part016.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:57 bg2.part017.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 10:59 bg2.part018.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 11:01 bg2.part019.rar* -r-xr-xr-x 1 root root 36700000 Jan 18 11:03 bg2.part020.rar* [EMAIL PROTECTED] elx]$ By using the size value above (with gcombust) I can create exactly 20 volumes that fit perfectly in the "official" space that a 700 meg cd can hold. Normally I get rar to do a test on the archives after they are created (before they are burned to cd) and then redirect that output to a file, which is then put on either the first or the last cd. rar t bg2.part001.rar > manifest.txt You can pick up rar from one of the mandrake mirrors, it doesn't come with the distro. ftp://ftp.ibiblio.org/pub/packages/rpmhelp/9.2/RPMS/rar-3.1.1-1rph.i386.rpm If you are running MDK10 or something like that you can get the src and do an rpm --rebuild on the source package to get a binary rpm for your distro version: ftp://ftp.ibiblio.org/pub/packages/rpmhelp/rar-3.1.1-1rph.src.rpm You would do "rpm --rebuild rar-3.1.1-1rph.src.rpm" Note -- I have tried other burn software other than Gcombust, and some of the software I tried could not fit the same amount of information on the CD's as Gcombust. LX -- ************************************************ Trouble with sound? Dump Alsa with an upgrade to the best: get your free high quality OSS drivers at www.opensound.com Superior features, superior API, better support. ************************************************
____________________________________________________ Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com Join the Club : http://www.mandrakeclub.com ____________________________________________________
