[SATLUG] How do you take a dump?
Bob Tracy
rct at gherkin.frus.com
Thu Feb 8 11:12:39 CST 2007
twistedpickles wrote:
> How do you backup info to HD's?
Someone has probably written a pretty proggie to handle it, but you
have all the pieces at your disposal to roll your own without getting
too fancy. My example will use "cpio" because I'm both hopelessly
old-fashioned, and come from an AT&T UN*X background.
Assuming a destination disk of greater-than-or-equal size compared to
the source disk, set up partitions equivalent to what's on the source
disk. When it's time to make the backup, mount your "mirror" partitions
relative to something like "/mnt/b" where "b" represents the backup "/"
partition on the destination disk. One possibility for a quick and
dirty scheme might look something like this:
for fs in `mount | cut -f3 -d' ' | egrep -v '/proc|/sys|/dev|/mnt/b'`
do
cd $fs
#
# replace leading '/' with './'
# (yes, this works for the root fs too)
#
mpd=`echo $fs | sed 's,/,\./,'`
find . -xdev -print | cpio -pdlvm /mnt/b/$mpd
done
Depending on your disk layout and the amount of data involved, it's
probably not worth the effort to worry about "full" vs. "incremental"
backups. You want automation? Run the whole shebang out of cron.
Less verbosity? Substitute '-V' for '-v' in the cpio arglist, or omit
it entirely.
--
-----------------------------------------------------------------------
Bob Tracy WTO + WIPO = DMCA? http://www.anti-dmca.org
rct at frus.com
-----------------------------------------------------------------------
More information about the SATLUG
mailing list