How-To recover stuff on KIPAC's amanda backup system
Introduction
Currently, we are running a number of services on kipac.stanford.edu including mailing lists, the plone web site, a cvs server, and some other stuff. To avoid catastrophic losses we use amanda running on kipac and kipac-dell2.stanford.edu to backup the important areas. Amanda is configured in /etc/amanda with scheduling in amanda.crontab and /etc/amanda/DailySet1/amanda.conf. We are using backup to disk rather than tape. There are six disk directories used to manage the 6 day dumpcycle which are in /amandatapes/daily. With the exception of plone, all disk areas are just backed up normally with kipac as the client and kipac-dell2 as the tapehost. For plone we actually use the zope provided backup program repozo.py to make incremental backups of the zodb and then only backup the repozo.py generated files. We do not backup the "instance/var" and "instance/log" directories. The reason for this is that repozo.py handles backing up the live zodb and doing incrementals, etc. leaving the results in "instance/backup".
Doing a backup session
On the backed-up client:kipac:# amrecover -s kipac-dell2 -t kipac-dell2 -d "file:/amandatapes/daily"At this point, switch to a session (via ssh or whatever) on the TAPEHOST and arrange for the server to use the correct disk area, this is expressed as "loading a tape" even though it is just using a directory on the filesystem. They hit return (here) to initiate the extraction.
amrecover> sethost kipac.stanford.edu -- set which host to recover
amrecover> lpwd -- show where we are on local file system
amrecover> listdisk -- list backed up areas available to recover
amrecover> setdisk <path> -- (eg "setdisk /a9/cvs", specify top level of recovery path)
amrecover> ls -- list stuff in the <path> on "tape"
amrecover> add <subdir> -- add a subdirectory of <path> to recovery set
amrecover> settape kipac-dell2:file:/amandatapes/daily -- set tapehost:device
amrecover> extract -- follow prompts as in example:
Extracting files using tape drive @DEFAULT_TAPE_DEVICE@ on host kipac-dell2.
Load tape daily4 now
Continue [?/Y/n/s/t]?
When it finishes with the first "tape" it may have to load another. If this happens again go to the session on the tapehost and arrange for the correct "tape" to be loaded.
Extracting files using tape drive @DEFAULT_TAPE_DEVICE@ on host kipac-dell2. Load tape daily6 now
Continue [?/Y/n/s/t]?
On the tape host (backup server)
kipac-dell2:/etc/amanda/DailySet1# su backup
kipac-dell2:/etc/amanda/DailySet1$ /usr/sbin/amtape DailySet1 slot 4
amtape: changed to slot 4 on file:/amandatapes/daily
kipac-dell2:/etc/amanda/DailySet1$ /usr/sbin/amtape DailySet1 slot 6
amtape: changed to slot 6 on file:/amandatapes/daily