Amanda

From Cheatsheet

Jump to: navigation, search

amanda is the enterprise server that's open source, relatively cool, pretty flexible, but more painful than some to install, this is how you do it on Debian. I'm starting with the howto on Sourceforge and customizing from there.

installation

Debian Lenny

 apt-get install amanda-server xinetd gawk gnuplot readline-common
 mkdir /etc/amanda/DailySet1
 gunzip /usr/share/doc/amanda-common/examples/amanda.conf.gz
 cp /usr/share/doc/amanda-common/examples/amanda.conf /etc/amanda/DailySet1/
 vi /etc/amanda/DailySet1/amanda.conf
   tapecycle 6 tapes
   tapetype DISK
   tpchanger "chg-disk"
   changerfile "/etc/amanda/DailySet1/changer"
   tapedev "file:/dumps/amandatapes/DailySet1"
 add to tapetype section (600G drive example):
   define tapetype DISK {
      comment "Backup to HD"
      length 102400 mbytes
   }
 create dumptype in dumptype section
   define dumptype example {
      global
      comment "example dumptype"
      compress client fast
      program "GNUTAR"
      strategy standard
      priority high
   }
 mkdir -p /dumps/amanda
 mkdir -p /dumps/amandatapes/DailySet1
 for i in 1 2 3 4 5 6; do mkdir /dumps/amandatapes/DailySet1/slot${i}; done
 touch /dumps/amandatapes/DailySet1/info
 ln -s /dumps/amandatapes/DailySet1/slot1 /dumps/amandatapes/DailySet1/data
 chown backup.backup /dumps
 chown -R backup.backup /dumps/amanda
 chown -R backup.backup /dumps/amandatapes
 su backup
 touch /etc/amanda/DailySet1/tapelist
 for i in 1 2 3 4 5 6; do /usr/sbin/amlabel DailySet1 DailySet1-${i} slot ${i}; done
 vi /etc/amanda/DailySet1/disklist
   laptopdns.name.or_IP /folderyouwanttobackup example (profile you created) 
 vi /etc/amandahosts (who can run this thing on the server)
   servername.or.ip backup
   servername.or.ip root
   laptopname.or.ip root

laptop configuration

 apt-get install amanda-client xinetd openssh-server
 vi /etc/amandahosts (add amanda server to it)
   servername.or.ip backup

server config test (as user backup)

 /usr/sbin/amcheck DailySet1

should output

 Amanda Tape Server Host Check
 -----------------------------
 Holding disk /dumps/amanda: 25063520 KB disk space available, using 24961120 KB
 slot 1: read label `DailySet1-1', date `20070911'
 NOTE: skipping tape-writable test
 Tape DailySet1-1 label ok
 Server check took 0.254 seconds
 Amanda Backup Client Hosts Check
 --------------------------------
 Client check: 1 host checked in 0.354 seconds, 0 problems found
 (brought to you by Amanda 2.5.1p1)

test run

 /usr/sbin/amdump DailySet1

you should see some incrementing files in ..................

 /dumps/amanda

test the backup (on the server)

 /usr/sbin/amtape DailySet1 slot 1
 /usr/sbin/ammt -t file:/dumps/amandatapes/DailySet1 rewind
 /usr/sbin/amrestore file:/dumps/amandatapes/DailySet1 laptopname.or.ip /home/unclecameron
 scp -C laptopname.or.ip._home.20070911.0 unclecameron@laptopname.or.ip:/tmp/backup

test your backup/restore on your laptop

 cd /tmp
 tar xvf backup

you should see your stuff

Personal tools