I've been experimenting with backing up Amanda's metadata as well as
data, so that I could, if necessary, restore on another machine. It's
time to put a new hard drive in my desktop, and install Linux anew,
sigh. So I used this as an opportunity to test my backup script. It's
crude, but it appears to work. I say "appears to" because it survived a
run of amcheck, and a run from cron this morning.

I call this script from a custom file in /etc/cron.d:

--------------------------------------------------
#! /bin/bash

# Run the amanda dumps and back up key amanda data. Run this as the
# backup user.

config="DailySet1"

/usr/sbin/amdump ${config}

umask 0066
cd /
tar cjf /crc/amanda10/back.var/var.lib.amanda.${config}.$(date
+\%a).tar.bz2 \
    var/lib/amanda/ --exclude=*~
tar cjf /crc/amanda10/back.etc/etc.amanda.${config}.$(date
+\%a).tar.bz2 \
    etc/amanda/ --exclude=*~
tar cjf /crc/amanda10/back.log/log.amanda.$(date +\%a).tar.bz2 \
    var/log/amanda/ --exclude=*~
--------------------------------------------------

(Watch that line wrapping.)

This script tosses the tarballs into the vtape directory, so that you
can use rsync to back the whole mess up to one or more offsite
external hard drives.

Obviously it could use improvement. It would be nice to grab the names
of the configurations from /etc/amanda, and directories to be backed
up from amanda.conf and loop through each configuration (in case you
had more than one). Or pass the configuration name in as an argument.
But this is a proof of concept.

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB

Reply via email to