*BSD News Article 27905


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!hookup!news.kei.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!vixen.cso.uiuc.edu!sdd.hp.com!elroy.jpl.nasa.gov!ncar!vail.Craycos.COM!fareast.craycos.com!not-for-mail
From: scott@craycos.com (Scott Bolte)
Newsgroups: comp.os.386bsd.questions
Subject: Re: How to backup to floppy. Yes, floppy :-)
Date: 28 Feb 1994 11:30:11 -0700
Organization: Cray Computer Corporation
Lines: 124
Message-ID: <2ktd7j$dhm@fareast.craycos.com>
References: <2k5c10$2m1@debbie.cc.nctu.edu.tw>
NNTP-Posting-Host: fareast.craycos.com
Summary: backup, perl, cpio, gzip, multi-volume

>	Is there anybody can tell me how to backup (or dump ... etc)
>	my 386BSD (/dev/wd0a) onto floppies (/dev/fd0a) .

	The easy approaches are multi-volume dump, tar and/or cpio
	programs. Unfortunately, blindly dumping all files to such a
	limited media usually results in an afternoon of
	swap-the-floppy.  Compression, either of the entire dump,
	individual volumes, or even individual files, helps some. But
	my experience shows a lot of floppies will still be needed.

	What I developed for my home use is a combination file filter
	and volume manager. It is implemented as a perl script that
	makes use of gzip and cpio. I can do an incremental dump of
	340M disk to four 1.44M floppies. Admittedly, it would take
	more if I did not skip the unchanged files in the FreeBSD
	source hierarchy.

	One of the key features is that it can reject files to reduce
	the set size. For example, all .o and core files can be
	rejected. Furthermore, all program binaries are also skipped.
	Entire trees such as /usr/share/man can also be ignored.

	It attempts to shuffle the file set so each volume is as full
	as possible. It also compresses each volume separately. So if
	disk 1 of a 9 disk set is lost you can still retrieve from the
	other 8.

	I am not inclined to just post it to the net. It is quite a bit
	of perl. It also has some things hard coded into it that are
	fine for my system; but they would require some modification to
	be used elsewhere. If you would like a copy let me know via
	email. I can send it out immediately as-is. Or if there is
	enough demand, I can clean it up some and send it out next
	week.

	I've included examples of what it does after my signature.

		Scott
___________________________________________________________________________
Scott Bolte                 scott@craycos.com               +1 719 540 4186
Cray Computer Corporation, 1110 Bayfield Drive, Colorado Springs, CO  80906
	     As anyone here will tell you: I speak for myself.

	 *** A solution our children pay for is not a solution ***

		-----------------------------------------

> fareast[24] ./nissbackup.pl --help
> Usage: nissbackup [options]
>     --                      Stop command line processing.
> 
>     -a or --all             Include all valid files regardless of
>                             modification times.
>     -b or --base path       Backup files starting at the base directory.
>     -l or --list            List the files eligible for archiving.
>     -m or --max size        The maximum number of bytes to be written.
>                             Can use modifiers of b=blocks (512), k=kilobytes,
>                             m=megabytes, or B=10 blocks (5120).
>                             No modifier implies bytes.
>     -o or --output device   Write the finished archive to the named device.
>     -p or --percent N       Use N as the estimated compression rate.
>                             The default is 77. Remember, it is better
>                             to underestimate the rate.
>     -t or --timestamp path  Use the modification time of the given
>                             timestamp file.
> 
>     -d or --debug           Run in debug mode, no files will be changed.
>     -v or --verbose         Enable the verbose status message.
>     -? or -h or --help      Print this usage statement.


> fareast[25] ./nissbackup.pl --output /tmp/ondisk                        \
>                             --timestamp /u/scott/tmp/delete/tstamp      \
>                             --base /u/scott/tmp/delete
> Searching for files in /u/scott/tmp/delete...
> Creating header, scripts, and file list in the dump directory...
> Creating volume vol-1...
> vol-1 is 61440 bytes long.
> Dumping volume vol-1 to "/tmp/ondisk".
> Read-back of vol-1 indicates all is well.
>     10 files were included in vol-1.
>      2 files were excluded.


> fareast[26] cpio -it < /tmp/ondisk | cat -n
>      1  dumpdir.94.02.28/README
>      2  dumpdir.94.02.28/backup:_u_scott_tmp_delete
>      3  dumpdir.94.02.28/backup:part_01_of_01
>      4  dumpdir.94.02.28/files.gz
>      5  dumpdir.94.02.28/script_dump.pl.gz
>      6  dumpdir.94.02.28/script_restore.pl.gz
>      7  dumpdir.94.02.28/vol-1.cpio.gz

	The first section just shows the usage statement. The second is
	an actual test run. Instead of going to a floppy device, the
	data is written to "/tmp/ondisk". Everything more recent than
	the "tstamp" file is considered. And the set of files is drawn
	from the directory "/u/scott/tmp/delete".

	The third command shows what the cpio image is that would have
	been written to floppy.

	    entry 1     A file that describes the format of the dump.

	    entry 2     An empty file. It just shows what was being
			saved. Note that instances of '/' are replaced
			with '_'.

	    entry 3     Another empty file. Provides an easy way to
			tell the number of volumes in the dump.

	    entry 4     A compressed list of all files that were
			candidates to be saved. Each file has a note
			indicating the volume on which it can be
			found.  Or, if it was rejected, that is noted
			too.

	    entry 5     The script used to make the backup is
	    		included.

	    entry 6     Eventually, a restore facility will be
	    		included.

	    entry 7     The compressed files on the volume.