Hello. Sorry, i'm noob.
I'm backing up postgres databases through named pipes. The backup process is
ok, but when I'm trying to restore it, I've got in trouble:
Bareos is restoring just named pipe, not data.
Please help.
Here is the scripts:
Take backup:
================================================================================================================
function make_dump {
pg_dumpall -h $1 -p 5432 -U $2 -g > $DUMPDIR/globalobjects.$2.dump
for dbname in $(psql -h $1 -p 5432 -U $2 -d template1 -q -t <<EOF
select datname from pg_database where not datname in
('template0','template1','root','postgres') order by datname;
EOF
)
do
mkfifo $FIFODIR/$dbname.schema.dump
pg_dump -h $1 -p 5432 -U $2 -F c -s $dbname --file=$FIFODIR/$dbname.schema.dump
2>&1 < /dev/null &
mkfifo $FIFODIR/$dbname.data.dump
pg_dump -h $1 -p 5432 -U $2 -F c -a $dbname --file=$FIFODIR/$dbname.data.dump
2>&1 < /dev/null &
done
}
make_dump $ip $user
To restore:
========================================================================================================================================================================
function prepare_pipes {
for dbname in $(psql -h $1 -p 5440 -U $2 -d template1 -q -t <<EOF
select datname from pg_database where not datname in
('postgres','template0','template1','root') order by datname;
EOF
)
do
mkfifo $FIFODIR/$dbname.schema.dump
/bin/dd if="$FIFODIR/$dbname.schema.dump" of="$FIFODIR/$dbname.schema.custom"
2>&1 < /dev/null &
mkfifo $FIFODIR/$dbname.data.dump
/bin/dd if="$FIFODIR/$dbname.data.dump" of="$FIFODIR/$dbname.data.custom" 2>&1
< /dev/null &
done
}
prepare_pipes $ip $user
=========================================================================================================================================================================
p.s.
If I set a variable with database name in the restore script - all works well.
But I'm trying to iterate through all databases in the cluster at once. . .
--
You received this message because you are subscribed to the Google Groups
"bareos-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
For more options, visit https://groups.google.com/d/optout.