Backup server
De Instituto de Física - UFRGS
Criar diretório:
mkdir /etc/amanda/NOME
Copiar arquivo de configuração padrão:
cp /usr/share/doc/amanda-common/examples/amanda.conf.gz /etc/amanda/NOME cd /etc/amanda/NOME gunzip amanda.conf.gz
Calculo do tamanho do tamanho das fitas:
Espaço disponível * 0,9 <= tamanho das fitas * typecycle
Edita amanda.conf
org "IF" mailto "fulano@if.ufrgs.br"
dumpcycle X days # the number of days in the normal dump cycle tapecycle X tapes # the number of tapes in rotation tpchanger "chg-disk:/Nome/slots" changerfile "/etc/amanda/Nome/changer.conf" tapetype HARD-DISK # what kind of tape it is (see tapetypes below) labelstr "^diario_[1-14]*$" # label constraint regex: all tapes must match infofile "/etc/amanda/Nome/curinfo" # database DIRECTORY logdir "/etc/amanda/Nome/log" # log directory indexdir "/etc/amanda/Nome/index" # index directory define tapetype HARD-DISK{ comment "HD" length 1000000 mbytes # 1TB } define changer "Nome" { tpchanger "chg-disk:/Nome/slots" }
Criar Diretórios
cd /Nome mkdir /Nome/slots mkdir /Nome/data mkdir /Nome/holding mkdir /etc/amanda/Nome/log mkdir /etc/amanda/Nome/curinfo mkdir /etc/amanda/Nome/index
Criar fitas
cd /Nome/slots for slot in `seq 1 25`; do mkdir slot$slot; done chown -R backup.backup /Nome chown -R backup.backup /etc/amanda/Nome su - backup $ TAPENUMS="1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ...." # up to your tapecycle $ for i in $TAPENUMS; do amlabel Nome Nome_$i slot $i; done $ amcheck DailySet1 #$ for i in $TAPENUMS; do mkdir -p slot$i; done $ ln -s slot1 data
Criar disklist
touch /etc/amanda/Nome/disklist Ex: #Amanda amanda /etc root-tar
Testando
su - backup amcheck Nome
Backup
amdump Nome
Erro: slot 1:Found an empty or non-amanda tape. slot 2:Found an empty or non-amanda tape.
backup@amanda:/semanal/slots$ TAPENUMS="1 2" backup@amanda:/semanal/slots$ for i in $TAPENUMS; do amlabel semanal semanal_$i slot $i; done
Cron tab:
# Backup diario 0 2 * * mon,thu,sat backup /usr/sbin/amcheck diario 0 4 * * mon,thu,sat backup /usr/sbin/amdump diario
# Backup semanal 0 3 * * sun backup /usr/sbin/amcheck semanal 0 5 * * sun backup /usr/sbin/amdump semanal
# Backup mensal 30 5 1 * * backup /usr/sbin/amcheck mensal 00 6 1 * * backup /usr/sbin/amdump mensal