The breakup command (also known as breaker.pl on some systems) is used to break a list of data lines, each consisting of a size and a text value, and to break the items into some number of batches, the total size of each being less than the maximum size specified on the command line. The original use of this algorithm was to break the files in a small system into batches which would fir onto some number of backup tapes, with each tape holding about the same number of bytes and being as full as possible given the equal size goal.
Example - backing up "/home"
find /home -type f -print0 | xargs -0 ls -s | breakup -n650000 -PbuCD
The files in the /home directory are listed with the file size in blocks. This results in a stream of lines with a size and filename going into breakup. Breakup is run with a maximum size of 650000 units, and in this case that would be 650MB batches, assuming that the block size was 1k. The -P option causes the batch files to be named buCDnnn, where "nnn" starts at 001. Each of these files holds the names of files in the /home directory with an aggregate size of no more than 650MB (a safe size for a CD).
The batches may then be backed up to CD using whatever software is the current site standard.
Example - backing up "/home" preserving filenames on a CD
find /home -type f -print0 | xargs -0 ls -s | breakup -n650000 -PbuCD -G
Preserving directory names (or not)
ISO images can be produced using the -graft-points and -path-list options on files created using the -G breaker option:
mkisofs -o CDimg001.iso -path-list buCD0001 -graft-points
The main use for this method is preserving directory names, since just using a directory name without -graft-points will result in the contents of the directory being in the root directory of the ISO image.
Using -graft-points with mkisofs (by itself):
To clarify this graft-point use, here are examples of using the option in the simplest form. Note that if the -G option is used to build the lists, the -graft-points option must be using with mkisofs.
mkisofs -o xx.iso /home/john
Would result in all of the files and directories from that directory being at the root of the ISO image (that's valid and may be what you want in some cases).
mkisofs -o xx.iso -graft-points /home/jihn=/home/jihn
Would result in an ISO image containing the same content as the previous example, but now in the original /home/jihn directory.
$Date: 2006/02/12 20:29:15 $