Another interesting idea would be to fit .mp3's on a CD. The files can't be split, but larger and smaller files can be combined. In the case of music, one might prefer to keep them in order, and then just look for small files to fill up the last remaining space.
Search through directories, and group the files by composer, and fill up each directory with similar files (e.g. all Bach on a group of CD's, all Vivaldi on another group, etc., or possibly combine by category such as Classical) Classical Bach Bethoven Handel Mozart If all the Bach CDs fill up with pure Bach, but there is still room on the last one, then consider taking one from anywhere under Classical. The whole idea may not be practical, since it may not make sense to split up certain pieces, or change the order. e.g. Vivaldi's Four Seasons would sound strange if they were out of order. The main idea is just to burn .mp3's back to a CD, but fit almost twice as much on a single CD than the original uncompressed format. So, I guess the idea is a "partially filled" bin packing problem. > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] Behalf Of Carl > Lowenstein > Sent: Wednesday, November 09, 2005 10:14 PM > To: Friendly list for people new to Linux > Subject: Re: backup to CD > > > On 11/8/05, Carl Lowenstein <[EMAIL PROTECTED]> wrote: > > On 11/8/05, Dave <[EMAIL PROTECTED]> wrote: > > > Um, I guess I should rephrase my question. > > > > > > There are scripts that you specify the size limit of a CD, it will > > > back all your data but stop at that size limit and create an ISO or > > > burn straight to a CD, then get more files to put in a new ISO. > > > Instead I would like the files put in a directory instead of in an > > > ISO. > > > > That is in fact the way that Chris Johnson's script works. It creates > > enough directories to hold all the files, distributing the files so as > > to fill each directory as close to the specified size as it can. > > > > < http://www.apress.com/book/download.html > > > Select "Shell Scripting Recipes" and click <submit>. You will get to > > a page where you can download a tar.gz file containing all the scripts > > from the book. Read the script, read the book, ... There are > > something like 128 scripts, an installation script, and a README file. > > > > The bin-pack script is 108 lines long, you can get it for yourself. > > Looking carefully at "bin-pack" I found that there is a function > "dir_size" missing. E-mail correspondence with the author verified > this, and I got a fix for it. One modifies the script > "standard-funcs", which is sourced by various other scripts. Here is > the fix: > diff -c -r1.1 standard-funcs-sh > *** standard-funcs-sh 2005/11/09 21:05:05 1.1 > --- standard-funcs-sh 2005/11/09 21:05:51 > *************** > *** 333,335 **** > --- 333,345 ---- > } > trap cleanup EXIT ## Set trap to call cleanup on exit > > + dir_size() ## calculate total size of files in directory/ies > + { > + for ds_dir > + do > + ls -l ${ds_dir:+${ds_dir%/}/} | > + grep -v '^d' | > + awk 'BEGIN {OFMT = "%d" } {total += $5} END { > print total }' > + done > + } > + > > Also, read the code carefully -- it might not do what you really want. > It is destructive of the original data, "mv"ing it into newly created > directories, and splitting files that are too large to fit on a single > output disk. > > Also be aware that there is some overhead in creating ISO9660 images, > so the 4700MB nominal size of a DVD will not hold 4700,000,000 bytes > of files. > > carl > -- > carl lowenstein marine physical lab u.c. san diego > [EMAIL PROTECTED] > > -- > [email protected] > http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie -- [email protected] http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-newbie
