[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: backup compress on the fly

Joe Mc Cool wrote:

my ancient, but reliable, backup script is essentially:

     find /my_dir | cpio -ov > /dev/st0

But, (now that I have installed all those lovely debian goodies), the
wretched tape is filling up and asking for another.   (I erase the
tape beforehand.)

I really want to fit all my current data, or certainly selected dirs
unto one tape.  Surely I should be able to compress the files before
they are sent to the tape.  I suspect it can be done with gzip, but I am not
sure of the syntax.  Obviously I need to get it right.

Whether compression is advisable depends on what your goal is.

If you are making archives, or you are backing up a system which,
if it failed and you lost everything it would be a terrible
disaster, then I recommend you *not* to compress your backups.

Compressed file formats are notoriously intolerant of medium
errors. It might be better to do subset backups each of which
fits onto a single tape.

Proceeding on,

There are three (at least) ways to proceed.

Abandon cpio and use a tar which can compress/decompress as it goes.
Continue to use cpio, and compress the image it creates.
Continue to use cpio, and compress the files before they are stored.

I am more familiar with tar than cpio. With the current GNU tar
releases, this would be

	# tar cvz [list of places to back up]

The "c" means "create", the "v" is "verbose" (optional) and the "z"
means "compress as with gzip the entire tar image".

To test the backup, use

	# tar tvz

To restore

	# tar xvz [list of places to restore]

(Again, the "v" is optional.)

See the man page or info for more. If you have a favorite
compression program, you can even use that, if you like.

This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!

Reply to: