Title: Amanda Backup Subject: How to Setup AMANDA backup client and server for backup to virtual tapes (I don't have a tape drive) By: John Stile ( john@stilen.com ) Copywrite: GPL-V2 ======================================== CLIENT SETUP ======================================== #============================== # Install amanda #============================== emerge amanda ######################## # XINETD ######################## cat > /etc/xinetd.d/amanda <<'XINETD' # These are the services needed for amanda. # Default is to talk to localhost only unless # AMANDA_SERVER was specified at build time. service amanda { socket_type = dgram protocol = udp wait = yes user = amanda group = amanda groups = yes server = /usr/libexec/amandad # You need to ensure this points to your Amanda server! # Don't just remove it! only_from = 127.0.0.1 disable = no } service amandaidx { socket_type = stream protocol = tcp wait = no user = amanda group = amanda groups = yes server = /usr/libexec/amindexd # You need to ensure this points to your Amanda server! # Don't just remove it! only_from = 127.0.0.1 disable = no } service amidxtape { socket_type = stream protocol = tcp wait = no user = amanda group = amanda groups = yes server = /usr/libexec/amidxtaped # You need to ensure this points to your Amanda server! # Don't just remove it! only_from = 127.0.0.1 disable = no } XINETD ######################## # AMANDAHOSTS ######################## cat > /etc/amanda/amandahosts <<'AMANDAHOSTS' localhost amanda AMANDAHOSTS #============================== # Hup the daemon #============================== /etc/init.d/xinetd restart ======================================== SERVER SETUP ======================================== BASE_DIR="/etc/amanda" BACKUP_NAME="DailySet1" TAPES_DIR="/mnt/sda2/amandatapes" LOG_DIR="/var/log/amanda" #============================== # Make directories: # config dir # tape dir # log dir #============================== mkdir ${BASE_DIR}/${BACKUP_NAME} mkdir /etc/amanda/${BACKUP_NAME} mkdir ${LOG_DIR} chown -R ${BASE_DIR}/${BACKUP_NAME} chown -R /etc/amanda/${BACKUP_NAME} chown -R amanda:amanda ${LOG_DIR} #============================== # Make tape directory #============================== mkdir /mnt/sda2/amandatapes chown -R amanda:amanda /mnt/sda2/amandatapes #============================== # Create: # amanda.conf # changer.conf # disklist #============================== ######################## # AMANDA CONFIG ######################## cat > ${BASE_DIR}/${BACKUP_NAME}/amanda.conf < ${BASE_DIR}/${BACKUP_NAME}/changer.conf < $BASE_DIR/${BACKUP_NAME}/disklist <<'DISKLIST' 127.0.0.1 /etc hard-disk-tar 127.0.0.1 /home hard-disk-tar DISKLIST #============================== # Make log directory #============================== mkdir /var/log/amanda chown -R amanda:amanda /var/log/amanda #============================== # Make tape directory #============================== mkdir /mnt/sda2/amandatapes chown -R amanda:amanda /mnt/sda2/amandatapes #============================== # change amanda's shell from /sbin/nologin to /bin/sh #============================== vi /etc/passwd #============================== # Create tapes #============================== for ((x=1;x<=14;x+=1)); do num=`printf "%02d" $x` mkdir -p ${TAPES_DIR}/tape${num}/data chown -R amanda:amanda ${TAPES_DIR}/tape${num} chmod -R 770 ${TAPES_DIR}/tape${num} amlabel DailySet1 DailySet1${num} slot ${num} done #============================== # Run amcheck until no errors occur # my may run into errors #============================== amcheck DailySet1 Amanda Tape Server Host Check ----------------------------- amcheck-server: slot 14: date X label DailySet114 (new tape) NOTE: skipping tape-writable test Tape DailySet114 label ok NOTE: info dir /var/log/amanda/curinfo: does not exist NOTE: it will be created on the next run. NOTE: index dir /var/log/amanda/index: does not exist NOTE: it will be created on the next run. Server check took 0.082 seconds Amanda Backup Client Hosts Check -------------------------------- Client check: 1 host checked in 0.018 seconds, 0 problems found (brought to you by Amanda 2.4.5)