GNU-tar vs dump(1)

Barry Shein bzs at Encore.COM
Sat Jan 7 08:34:13 AEST 1989


Another limitation of using tar (which, again, I don't know if gnutar
attacked) is restoring device entries. This isn't always a problem
since you usually got a working /dev/ from somewhere to start the
restore but if there are other device entries which are normally
dumped/restored this could be a consideration.

It can be handled with a simple shell script to dump and restore these
(you could create it and put it to tape automatically), basically a
big find and then an awk postprocessor program to turn this into a
shell script to do the necessary mknod's if needed later, then save
that to tape, 99% of it is:

	find /filesys \( -type c -o -type b \) -exec ls -l '{}' ';' | \
		awk -f todev > outfile ; chmod u+x outfile

where todev is:

BEGIN {
	print "#!/bin/sh"
}
{
	print "mknod " substr($1,0,1) " " substr($4,0,length($4)-1) \
		" " $5 " " $9
}

(ok, that was gratuitous fun...but it was clean fun.)

	-Barry Shein, ||Encore||



More information about the Comp.unix.wizards mailing list