Open-Source Backups Using Amanda
Listing 4. Using amrecover
[root]# amrecover -C DailySet1 AMRECOVER Contacting server on localhost 220 jule AMANDA index server (2.4.2p2) ready. 200 Access OK Setting restore date to today (2004-02-13) 200 Working date set to 2004-02-13. 200 Config set to DailySet1. 200 Dump host set to localhost. Can't determine disk and mount point from $CWD amrecover> sethost localhost 200 Dump host set to localhost. amrecover> setdisk /home 200 Disk set to /home. amrecover> ls 2004-01-29 condor/ amrecover> add condor Added dir /condor at date 2004-01-29 amrecover> extract Extracting files using drive /dev/nst0 on localhost. The following tapes are needed: DailySet3 Restoring files into directory /restored Continue? [Y/n]:
Each Amanda client stores helpful information from the crontab runs in /tmp/amanda. Here you can find logs from amandad, selfcheck (the check that runs prior to backup) and sendbackup, all with an accompanying date. Once the backups are completed, the tapes stored and changed and all backup procedures completed, it is not yet time to call it a wrap on the data. Amanda includes a couple of handy programs, amverify and amverifyrun, that verify the media as well as the data from any Amanda run that already has taken place. It is a good idea to run through amverify from time to time (as time allows, if not every time) to verify that your backups actually are going to be recoverable. Because you have dedicated the time and effort to configure and carry out a mostly automated and consistent backup scheme, it only makes sense to verify that all is well. And, you are keeping some of your sets of tapes off site, right?
I must quickly mention the sole visual utility available with Amanda, amplot. amplot has the ability to read an Amanda output file and create a graphical interpretation of your backups, allowing the administrator to determine the efficiency of the Amanda install and configuration and whether any changes need to be made.
Walking barefoot through broken glass is no fun. That being said, I have been in situations where I would rather walk through that broken glass barefoot than have to deal with miserable data recovery. Data recovery with Amanda, however, is both simple and fun. Well, maybe it isn't exactly fun, but a certain amount of satisfaction comes from restoring data. Running amrecover provides you with an easy-to-use command-line interface for browsing files and directories. The interface allows you to browse, add and extract single files or directories. This entails multiple steps, setting the date, setting the disk and setting the host. For example,
/usr/sbin/amrecover -C myconfig1 -t localhost -s localhost
instructs amrecover to use the DailySet1 configuration (-C), the index host of localhost (-t) and the Amanda server of localhost (-s); see Listing 4.
One fear when dealing with backups, especially indexed backups, is what happens when your master index drive fails. If you're recovering from indexes and your master Amanda drive fails, are you out of luck? Not at all. amrestore allows you to restore a full Amanda image without using indexes and without the need for any configurations. amrestore also can be used to do complete filesystem restores. In my experience, amrestore is most useful if you lose your master Amanda drive. You can start with a fresh install and run amrestore, recover the complete image and begin where you left off with all previous indexes and configurations. As a side note, I make a monthly dump of both the Amanda home directory and the Amanda configuration directories to an alternate machine. This allows me to reference the config files should a master drive die and unexpected problems arise.
Amanda is an excellent open-source backup application that is highly configurable to accommodate cross-platform backups. As with all software, it may not be the right application for every environment, but it does fit many backup needs. The following are what I see to be the pros and cons of the Amanda backup software.
Once Amanda is configured and the crontab is set up accordingly, it is possible to have hands-off consistent backups. Amanda can run on almost every UNIX and Linux platform available. It also is able to back up Windows data through Samba shares. In addition, Amanda is highly compatible with most backup media and hardware.
As for the cons, Amanda does not have the ability to span tapes at this time. This means that once each Amanda run is completed, the tape is moved to the bottom of the heap and a new tape is requested. Some users might consider the command-line interface to be a disadvantage. Finally, although it currently can be done, backing up to media other than tape, such as disk arrays, is somewhat difficult with Amanda.
Phil Moses spends his days working as a Systems Manager for the Physical Oceanography Group at Scripps Institution of Oceanography in San Diego, California. He spends his nights and time off dreaming of tropical environments with clean warm water, uncrowded waves, boats and plenty of tuna. Comments are invited at firstname.lastname@example.org.
- High-Availability Storage with HA-LVM
- DNSMasq, the Pint-Sized Super Dæmon!
- March 2015 Issue of Linux Journal: System Administration
- Localhost DNS Cache
- Real-Time Rogue Wireless Access Point Detection with the Raspberry Pi
- Days Between Dates: the Counting
- The Usability of GNOME
- PostgreSQL, the NoSQL Database
- Linux for Astronomers
- You're the Boss with UBOS