Bitácora de abrahamocf

Raspaldo de Basedatos

#! / bin / bash
DIA=`date +%d-%m-%y`
TIME=`date +%H:%M`
#CKUPDISK1=/volume1/BD-ADVBACKUPS/ADVres
BACKUPDISK2=/volume1/BD-ADVBACKUPS/ADVresp

for db in `psql -U postgres -d template1 -q -t << EOF
select datname from pg_database where not datname in ('template0') order by
EOF
`
do

if [ $1 = 1 ]; then
DIRECTORY=$BACKUPDISK1/$db
BACKUPFILE=$DIRECTORY/$db.[$TIME].$DIA
echo $BACKUPFILE
else
DIRECTORY=$BACKUPDISK2/$db
BACKUPFILE=$DIRECTORY/$db.[$TIME].$DIA
echo $BACKUPFILE
fi
echo $DIRECTORY
if [ -d $DIRECTORY ]; then
echo "BASE DE DATOS EXISTENTE"
else

Distribuir contenido