Amanda Quick

From Devpit
Jump to: navigation, search

Server setup, FreeBSD

"The ideal scenario is for the tapecycle to be at least (runspercycle + 1) * runtapes."[1]

Execute:

$ pkg install amanda-server
$ mkdir -pv /usr/local/etc/amanda /var/db/amanda /var/lib/amanda /backup/daily
$ touch /var/lib/amanda/.amandahosts
$ chown -Rvv amanda:amanda /usr/local/etc/amanda /var/db/amanda /var/lib/amanda /backup/daily
$ su -m amanda -c 'amserverconfig daily --template=harddisk --tapedev=/backup/daily --mailto=root@example.com --dumpcycle=1week --runspercycle=5 --runtapes=1 --tapecycle=18'
Logging to /tmp/amanda/amserverconfig.20160125160043.debug
mkdir /usr/local/etc/amanda/daily
mkdir /usr/local/etc/amanda/template.d
/usr/local/etc/amanda/template.d directory created
mkdir /var/lib/amanda/gnutar-lists
/usr/local/etc/amanda/daily/advanced.conf created and updated
mkdir /usr/local/etc/amanda/daily/curinfo
mkdir /usr/local/etc/amanda/daily/index
curinfo and index directory created
tapelist file created
disklist file created
Creating custom configuration using templates
custom amanda.conf created
creating vtape directory
amlabel vtapes
mkdir slot1
mkdir slot11
mkdir slot12
mkdir slot13
mkdir slot14
mkdir slot15
mkdir slot16
mkdir slot17
mkdir slot18
changer is reset
/var/lib/amanda/example/xinetd.amandaserver contains the latest Amanda server daemon configuration.
Please merge it to /etc/xinetd.d/amandaserver.
DONE.

Edit /usr/local/etc/amanda/daily/amanda.conf, change auth from "bsdtcp" to "ssh".

Adding a client, FreeBSD

Client side

  • Execute:
pkg install amanda-client
pw usermod amanda -s /bin/sh
  • Install ~amanda/.ssh/authorized_keys

Server side

  • Add the host key to ~amanda/.ssh/known_hosts:
su -m amanda -c 'ssh -o StrictHostKeyChecking=no foo.example.com echo ok'
  • Add the client to /usr/local/etc/amanda/daily/disklist.
  • Check config:
su -m amanda -c 'amcheck daily'

Adding a client, Windows

  • Download and install http://www.zmanda.com/download-amanda.php
  • Unless you've changed FreeBSD's username from amada to amandabackup, use regedit to set HKEY_LOCAL_MACHINE\SOFTWARE\zmanda\zwc\1.0\Install\backupUser = amanda.

Notes

On FreeBSD, Amanda's variable files are scattered far and wide. They are stored in:

  • /var/db/amanda (this is ~amanda)
  • /var/lib/amanda
  • /usr/local/var/amanda

Quick password generator:

tr -dc A-Za-z0-9 < /dev/urandom | head -c32;echo

See Also

[1] https://wiki.zmanda.com/index.php/Tapecycle

[2] http://www.mast.queensu.ca/computing/department/service.catalogue/backup/cheat-sheet.html