Mudanças entre as edições de "Server amanda"
De Instituto de Física - UFRGS
(17 revisões intermediárias pelo mesmo usuário não estão sendo mostradas) | |||
Linha 18: | Linha 18: | ||
dumpcycle X days # the number of days in the normal dump cycle | dumpcycle X days # the number of days in the normal dump cycle | ||
tapecycle X tapes # the number of tapes in rotation | tapecycle X tapes # the number of tapes in rotation | ||
− | tpchanger "chg-disk:/ | + | tpchanger "chg-disk:/Nome/slots" |
− | changerfile "/etc/amanda/ | + | changerfile "/etc/amanda/Nome/changer.conf" |
tapetype HARD-DISK # what kind of tape it is (see tapetypes below) | tapetype HARD-DISK # what kind of tape it is (see tapetypes below) | ||
labelstr "^diario_[1-14]*$" # label constraint regex: all tapes must match | labelstr "^diario_[1-14]*$" # label constraint regex: all tapes must match | ||
− | + | infofile "/etc/amanda/Nome/curinfo" # database DIRECTORY | |
− | infofile "/etc/amanda/ | + | logdir "/etc/amanda/Nome/log" # log directory |
− | logdir "/etc/amanda/ | + | indexdir "/etc/amanda/Nome/index" # index directory |
− | indexdir "/etc/amanda/ | + | |
− | + | ||
define tapetype HARD-DISK{ | define tapetype HARD-DISK{ | ||
comment "HD" | comment "HD" | ||
length 1000000 mbytes # 1TB | length 1000000 mbytes # 1TB | ||
} | } | ||
− | define changer " | + | define changer "Nome" { |
− | tpchanger "chg-disk:/ | + | 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 | ||
− | |||
− | |||
− | + | [[Amanda|Voltar para página Amanda]] | |
− | + | [[Configuração Básica]] | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | [[Adicionar Fitas]] |
Edição atual tal como às 19h34min de 1 de julho de 2011
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