Streams allow the output of just about any Unix command to be used as the input to just about any other unix command. Kind of like lego's, but for computers.
The commands that are a part of Unix are designed to fill just about every need you can think of, and they all work together pretty well.
Here is a simple example. Say you just grabbed a text file that has the contents of your local phone book, and you would like to see a list of everyone with your last name, and see that list sorted in alphebetical order, and have that list dumped to the printer. In windows, this would be a hassle at best, and would more than likely involve a lot of manual steps. In Unix, with pipes, it is easy and automatic.
First consider the individual steps. The grep
looks at incoming data, compares it to a matching patten, and outputs
a line of data only if the line matches. Therefore, the command to
grep a file or a stream of data for all lines that include the name
Kilgallon would be
grep kilgallon sourcefile.txt
Because we specified a filename (sourcefile.txt), grep gets it's data from there. If we had not specified a filename, grep would have expected data to be incoming on a stream.
Next, the command to sort a stream of data would be
sort
Finally, the command to print a stream of data is (at least on Linux systems)
lpr
So, to achieve the original goal, we tie the commands together with pipes, and let them drive each other. The command would look as follows:
grep kilgallon | sort | lpr
The example shown above is very simple, and
pretty unremarkable. The real power lies in the wide variety of
programs that can be data sources and data sinks. For the backburner
package, there are three commands that do most of the work, dd,
tar, and gzip
.
dd
command This command will take data from and send data too just about anything you can hook up to a computer... the keyboard, a raw disk partition, the mouse, a tape drive, a file on a disk, a floppy, the screen, another program... you get the idea. For the backburner package, it allows us to convert a disk partition into a stream of data, and later to convert a stream of data back to a disk partition. This means we can create and restore bit for bit images of any kind of disk partition. Like any self respecting unix command, there are tons of optional arguments that can do many handy things during this translation. Everything you might need is here somewhere.
tar
command This command will translate a mounted file system into a stream of data, or translate a stream of data back into a file system. It can (depending on the options you desire) maintain all creation times and ownership attributes, file system locations, and every other important aspect of a filesystem. You can specify files or directory hierarchies to include or exclude, how to handle symbolic links, what to do with mounted filesystems, and tons of other behaviors. Again, if you will need it, tar can more than likely do it.
gzip
command This command will take a stream of data and compress or uncompress it. On a typical file system, it achieves a two to one compression ratio. On already compressed data such as zip files or jpegs, it will achieve nothing. It is a lossless compression algorithim, which means that once the stream is uncompressed again, the data is exactly identical to the original stream.
You probably guessed it by now. Backburner works because the dd command can translate a disk partition into a stream of data, feed it to gzip, and then backburner can capture it. Backburner can then play the stream back, use gzip to uncompress it, and feed it back to dd, thus restoring an exact copy of a disk partition.
Likewise, tar can take a file system, convert it to a stream, feed it to gzip to compress it, then use backburner to store the stream. Later, backburner can restore this stream, use gzip to uncompress it, and feed it back to tar to re-create the original file system.
The commands are hard, but they are incredibly full featured, highly functional, and completely flexible. They are well documented in the man pages, and are widely used and available.
Return to Backburner documentation