Enviado em 06/11/2016 - 13:49h
estou executando o seguinte script:#!/bin/sh # Script para backup dos bancos de dados # Formata data para adicionar ao nome dos arquivos t=`/bin/date +%d%m%y` tt=`/bin/date +%H%M%S` # Define o destino dos arquivos DST="/home/fernandounix/f/$t" # Cria o diretório do dia se ele não existir if [ -d /home/fernandounix/f/$t ]; then cd /home/fernandounix/f/$t else `mkdir /home/fernandounix/f/$t` fi # Define permissoes de leitura e gravacao para o diretorio `chown -R postgres /home/fernandounix/f/` `chown -R postgres /home/fernandounix/f/$t` `chmod 0777 /home/fernandounix/f/$t` # variáveis export PGPASSWORD="toor" # Loop para gerar arquivos dump for i in `psql -l -U postgres | cut -f 2 -d " " -s`; do if [ $i != template1 -a $i != template0 -a $i != "rows)" -a $i != postgres ]; then /usr/bin/pg_dump -h localhost -U postgres /$t/$i"_"$t"_"$tt.bkp; fi done
fernandounix@Host-0000:~/Escritorio$ ./backupPostgreSQL.sh chown: cambiando el propietario de «/home/fernandounix/f/061116»: Operación no permitida chown: cambiando el propietario de «/home/fernandounix/f/»: Operación no permitida chown: cambiando el propietario de «/home/fernandounix/f/061116»: Operación no permitida pg_dump: [archiver (db)] connection to database "/061116/ExcelTest_061116_134016.bkp" failed: FATAL: database "/061116/ExcelTest_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/ProjetoVeiculos_061116_134016.bkp" failed: FATAL: database "/061116/ProjetoVeiculos_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/aula_061116_134016.bkp" failed: FATAL: database "/061116/aula_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/fazenda_061116_134016.bkp" failed: FATAL: database "/061116/fazenda_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/jcsmsexpressdb_061116_134016.bkp" failed: FATAL: database "/061116/jcsmsexpressdb_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/teste_061116_134016.bkp" failed: FATAL: database "/061116/teste_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/teste_jsf_html5_061116_134016.bkp" failed: FATAL: database "/061116/teste_jsf_html5_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/vendas_produto_061116_134016.bkp" failed: FATAL: database "/061116/vendas_produto_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/webservice_061116_134016.bkp" failed: FATAL: database "/061116/webservice_061116_134016.bkp" does not exist
Enviado em 06/11/2016 - 15:58h
#!/bin/sh # Script para backup dos bancos de dados # Formata data para adicionar ao nome dos arquivos t=`/bin/date +%d%m%y` tt=`/bin/date +%H%M%S` # Define o destino dos arquivos DST="/home/fernandounix/f/$t" # Cria o diretório do dia se ele não existir if [ -d /home/fernandounix/f/$t ]; then cd /home/fernandounix/f/$t else `mkdir /home/fernandounix/f/$t` fi # Define permissoes de leitura e gravacao para o diretorio `chown -R postgres /home/fernandounix/f/` `chown -R postgres /home/fernandounix/f/$t` `chmod 0777 /home/fernandounix/f/$t` # variáveis export PGPASSWORD="toor" # Loop para gerar arquivos dump for i in `psql -l -U postgres | cut -f 2 -d " " -s`; do if [ $i != template1 -a $i != template0 -a $i != "rows)" -a $i != postgres ]; then /usr/bin/pg_dump -h localhost -U postgres /$t/$i"_"$t"_"$tt.bkp; fi done
fernandounix@Host-0000:~/Escritorio$ ./backupPostgreSQL.sh chown: cambiando el propietario de «/home/fernandounix/f/061116»: Operación no permitida chown: cambiando el propietario de «/home/fernandounix/f/»: Operación no permitida chown: cambiando el propietario de «/home/fernandounix/f/061116»: Operación no permitida pg_dump: [archiver (db)] connection to database "/061116/ExcelTest_061116_134016.bkp" failed: FATAL: database "/061116/ExcelTest_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/ProjetoVeiculos_061116_134016.bkp" failed: FATAL: database "/061116/ProjetoVeiculos_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/aula_061116_134016.bkp" failed: FATAL: database "/061116/aula_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/fazenda_061116_134016.bkp" failed: FATAL: database "/061116/fazenda_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/jcsmsexpressdb_061116_134016.bkp" failed: FATAL: database "/061116/jcsmsexpressdb_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/teste_061116_134016.bkp" failed: FATAL: database "/061116/teste_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/teste_jsf_html5_061116_134016.bkp" failed: FATAL: database "/061116/teste_jsf_html5_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/vendas_produto_061116_134016.bkp" failed: FATAL: database "/061116/vendas_produto_061116_134016.bkp" does not exist pg_dump: [archiver (db)] connection to database "/061116/webservice_061116_134016.bkp" failed: FATAL: database "/061116/webservice_061116_134016.bkp" does not exist
Resolver problemas de Internet
Como compartilhar a tela do Ubuntu com uma Smart TV (LG, Samsung, etc.)
Descritores de Arquivos e Swappiness
Como instalar no Linux Jogos da Steam só para Windows
Instalando o Team Viewer no Debian Trixie - problema no Policykit
O Que Fazer Após Instalar Ubuntu 25.04