Surgiu a necessidade de mescar 2 ambientes plone-2.5.5, totalizando 23 aplicações (plone_site).
O Backup de cada aplicação é realizado diariamente em diretórios específicos, utilizando o comando repozo, como apresentado abaixo:
Diretórios de Backup
Script com find + repozo para restore
/storage/backup/orion/prod/cluster8220/zeoserver/brasilconectado_BD /storage/backup/orion/prod/cluster8220/zeoserver/cepReunioes_BD /storage/backup/orion/prod/cluster8220/zeoserver/consea_redeconsea_BD /storage/backup/orion/prod/cluster8220/zeoserver/digepgestaoambiental_BD /storage/backup/orion/prod/cluster8220/zeoserver/digepgestaopessoas_BD /storage/backup/orion/prod/cluster8220/zeoserver/observatoriodegenero_BD /storage/backup/orion/prod/cluster8220/zeoserver/saf_coloquio_BD /storage/backup/orion/prod/cluster8220/zeoserver/sajcentrodeestudos_BD /storage/backup/orion/prod/cluster8220/zeoserver/sicgov_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/consea_pec_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/diadobibliotecario_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/digepgestaoambiental_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/sa_acessoainformacao_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/saf_coloquio_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/saf_mercosul_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/saf_projetos_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/sagproreg_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/sajcentrodeestudos_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/saj_seminarionovocpc_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/sa_restauracao_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/seminarioprocessolegislativo_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/sg_juventude_conferencia_BD /storage/backup/orion/prod/PRTemaSimples/cluster8200/zeoserver/sg_juventude_riomais20BDA estrutura nova consiste nos arquivos citados a seguir:
/opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/brasilconectado_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/cepReunioes_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/clusterDB.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/consea_pec_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/consea_redeconsea_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/diadobibliotecario_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/digepgestaoambiental_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/digepgestaopessoas_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/observatoriodegenero_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sa_acessoainformacao_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/saf_coloquio_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/saf_mercosul_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/saf_projetos_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sagproreg_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sag_reg_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sajcentrodeestudos_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/saj_seminarionovocpc_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sa_restauracao_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/seminarioprocessolegislativo_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sg_juventude_conferencia_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sg_juventude_riomais20_BD.fs /opt/env-buildout/prod/8130-p255-PRTemaSimples-1389368167/var/filestorage/sicgov_BD.fs
O comando repozo, possui a sintaxe abaixo:Já existe uma rotina de backup para este ambiente, usarei o repozo para recuperar o backup e mescar os ambientes.
backuprepozo -BFzvf /path/filestorage/filestorage_BD.fs -r /path/backup/filestorage_BD/Este comando gera 2 arquivos, .dat e .fsz, um contem os dados e o outro o índice para reestruturação do plone_site.exemplo:restore
2014-01-13-03-03-30.dat
2014-01-13-03-03-30.fszrepozo -vRo /path/filestorage/filestorage_BD.fs -r /path/backup/filestorage_BD/ -D '2014-01-13-03-03-30'Este comando localiza o arquivo de backup no repositório definido em '-r', com o timestamp definido em '-D', ou o anterior mais recente.
Script com find + repozo para restore
find /storage/backup/orion/prod/{cluster8220,PRTemaSimples} -type f -mtime 0 -path "*BD*" -printf '%h\n'|sort -u|while read a; do echo bin/repozo -vRo var/filestorage/`sed 's/sg_juventude_riomais20BD/sg_juventude_riomais20_BD/' <<< \`basename $a\``.fs -r $a; doneA saída do script será como abaixo para todos os backups encontrados do diretório de repositório.
bin/repozo -vRo var/filestorage/brasilconectado_BD.fs -r /storage/backup/orion/prod/cluster8220/zeoserver/brasilconectado_BD
Comentários