AMANDA Installation and Operations

From BC's PCs Wiki

manual pages: http://wiki.zmanda.com/man/amanda.8.html

Contents

Install Amanda Server

sudo dpkg --install amanda-backup-server_2.6.1p1-1_i386.deb
...if there were missing packages, fixed by doing this:
sudo apt-get -f install

As root set password for user amandabackup

sudo passwd amandabackup
...set password to "amanda"

Install Amanda on clients

Note: Installation will fail on Windows if you have an older version already installed. Just make sure you uninstall old versions before proceeding with install.

  • unzip the 'ZWCInstaller-Community-26.zip' into a temp folder
  • run setup.exe
  • use default install path
  • enter "amanda" for amandabackup user password ...not sure if this password is for the server or just the client ( just client )
...server hostname entered: "data-server"

Configure the Amanda Server (as amandabackup user)

harddisk may need to be defined in amanda.conf, you can do it like this:

define tapetype HARDDISK {
       comment "Virtual Tapes"
       length 500000 mbytes
}
  • dumpcycle - The number of days in the backup cycle. Each disk using this set of options will get a full backup at least once in this period. Setting this to zero tries to do a full backup each run.
  • runspercycle - The number of amdump runs in dumpcycle days. A value of 0 means the same value as dumpcycle. A value of -1 means guess the number of runs from the tapelist(5) file, which is the number of tapes used in the last dumpcycle days / runtapes.
  • tapecycle - Typically tapes are used by Amanda in an ordered rotation. The tapecycle parameter defines the size of that rotation. This parameter must be be larger than the number of tapes used in a dumpcycle. Usually dumpcycle + 1.
  • runtapes - The maximum number of tapes used in a single run.

This will run amdump once a day, doing full backups weekly. It will keep 14 days worth of data.

amserverconfig DailySet1 --template harddisk --tapedev /mnt/raid/amanda/vtape/DailySet1 --mailto root@localhost --dumpcycle 7 --runspercycle 7 --tapecycle 14 --runtapes 1

This will run amdump once a day, doing full backups bi-weekly. It will keep 15 days worth of data.

amserverconfig DailySet1 --template harddisk --tapedev /mnt/raid/amanda/vtape/DailySet1 --mailto ben@bcspcsonline.com --dumpcycle 14 --runspercycle 14 --tapecycle 15 --runtapes 1
Configure server for zwc client (as amandabackup user)
zwc-compress can be defined by placing this in amanda.conf
define dumptype zwc-compress {
   global
   auth "bsdtcp"
   compress client fast
   program "DUMP"
   estimate client
}
If estimates timeout and cause backup to fail, you can use "estimate calcsize" to speed things up at the expense of accuracy. "estimate server" is fastest and least accurate.
amaddclient --config DailySet1 --client the-black-pearl --diskdev "C:/Documents and Settings/Ben/My Documents" --dumptype zwc-compress
...if you have spaces in path (like C:/Documents and Settings/...) you need to put quotes around the path in /etc/amanda/DailySet1/disklist file
...Also, use forward slashes "/" in paths

Check the server configuration (as amandabackup user)

...make sure you can ping clients, if not, add them to /etc/hosts file
...To get server to verify client, i had to add 192.168.2.102 (server ip) to client config
amcheck DailySet1

Turn on Holding Disk

...uncommented the following in advanced.conf

Set amcheck and amdump to run automatically with crontab (/etc/crontab file)

crontab format:
minute(0-59) hour(0-23) dayofmonth(1-31) month(1-12, Jan, Feb,...) dayofweek(0-6,Sun,Mon,...(0=Sun,1=Mon)) user-to-run-command command-to-be-executed
","=list of values, "-"=range of values, "*"=all possible values
use this command to open the crontab editor
crontab –e
add this line to the crontab file to run "/usr/sbin/amdump DailySet1" as the "amandabackup" user every day at 4pm
0 16 * * * amandabackup /usr/sbin/amdump DailySet1

Find recoverable data (as amandabackup user)

syntax:

amadmin <BackupSetName> find <hostname> <disk>
amadmin DailySet1 find the-black-pearl "C:/Users/Ben/Documents"
amadmin DailySet1 find the-black-pearl "C:/Users/Ben/Desktop"
amadmin DailySet1 find black-book "C:/Users/Ben/Documents"
amadmin DailySet1 find black-book "C:/Users/Ben/Desktop"
amadmin DailySet1 find baby_laptop "C:/Documents and Settings/Erin/My Documents/Documents"
amadmin DailySet1 find baby_laptop "C:/Documents and Settings/Erin/My Documents/Home Videos"
amadmin DailySet1 find baby_laptop "C:/Documents and Settings/Erin/My Documents/My Music"
amadmin DailySet1 find baby_laptop "C:/Documents and Settings/Erin/My Documents/My Pictures"
amadmin DailySet1 find baby_laptop "C:/Documents and Settings/Erin/Desktop"

returns:

date                host            disk                                                     lv tape or file file part status
2009-06-16 22:10:51 the-black-pearl "C:/Documents and Settings/Ben/My Documents/My Pictures"  0 DailySet1-1     1  1/1 OK

Restore data (as amandabackup user)

change cwd to desired restore directory before executing amfetchdump

syntax:

  amfetchdump <BackupSetName> <host> <disk> <YYYYMMDDHHMMSS>
  amfetchdump DailySet1 the-black-pearl "C:/Documents and Settings/Ben/My Documents/My Pictures" 20090616221051
  amfetchdump DailySet1 the-black-pearl "C:/Documents and Settings/Ben/My Documents/My Pictures" 20090617184102
  amfetchdump DailySet1 the-black-pearl "C:/Documents and Settings/Ben/My Documents/" 20090820111615

returns:

  amandabackup@data-server:~/restore$ amfetchdump DailySet1 the-black-pearl "C:/Do
  1 tape(s) needed for restoration
  The following tapes are needed: DailySet1-1
  Press enter when ready
  amfetchdump: slot 1: time 20090616221051 label DailySet1-1 (exact label match)
  Scanning volume DailySet1-1 (slot 1)
  amfetchdump: 1: restoring FILE: date 20090616221051 host the-black-pearl disk "C

this will put a file in your current working directory change it's extension to .tar and unzip with WinRAR

Reports

will generate a report and mail it to amanda admin

amreport DailySet1

will generate a report and send it to

amreport DailySet1 -M ben@bcspcsonline.com

Other stuff

force level 0 backup on next amdump run

amadmin DailySet1 force the-black-pearl

Delete the specified disks on hostname from the Amanda database

amadmin DailySet1 delete the-black-pearl "C:/Documents and Settings/Ben/My Documents/My Pictures"

TO DO:

send e-mails to a good address

Other Notes

There was an issue with the windows client where incremental backups would always perform full dumps, this has been fixed in version 2.6.1p2. See this thread