leonardothibes / puppet-svn

A puppet module to manage subversion repositories
http://forge.puppetlabs.com/leonardothibes/svn
Other
0 stars 0 forks source link

Classe svn::backup::ftp #8

Open leonardothibes opened 10 years ago

leonardothibes commented 10 years ago

Implementar classe de backup em FTP.

leonardothibes commented 10 years ago

A chamada da classe deverá ser a seguinte:

svn::backup::ftp {'database':
    hostname         => 'ftp.bau.com.br',
    username         => 'lidercap_bkp',
    password         => 'senha-para-backup-do-svn',
    location         => '/backups/svn',
    compression      => 'gz',
    recurrence_hour  => '12',
    local_retention  => '2',
    remote_retention => '30',
}
leonardothibes commented 10 years ago

Referência: http://www.stratigery.com/scripting.ftp.html

leonardothibes commented 10 years ago

Agora um exemplo:

tar -czvf /backups/bkp_capa1304.tar.gz distribuidor/ jequiti/
cd /backups
tar -czvf /var/lib/bkp_tar/bkp_capa1304.tar.gz .

W_ARQUIVO=bkp_capa1304.tar.gz

W_HOST_FTP=10.128.32.41
W_USUARIO_FTP=cap1304bkp
W_SENHA_FTP=123mudar

ftp -in <<EOF
open $W_HOST_FTP
user $W_USUARIO_FTP $W_SENHA_FTP
bin
lcd /var/lib/bkp_tar
cd /home/cap1304bkp
put $W_ARQUIVO
bye
EOF

rm /var/lib/bkp_tar/bkp_capa1304.tar.gz -f