summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/components/sqldb/pgsql-backup
diff options
context:
space:
mode:
Diffstat (limited to 'sca-cpp/trunk/components/sqldb/pgsql-backup')
-rwxr-xr-xsca-cpp/trunk/components/sqldb/pgsql-backup12
1 files changed, 10 insertions, 2 deletions
diff --git a/sca-cpp/trunk/components/sqldb/pgsql-backup b/sca-cpp/trunk/components/sqldb/pgsql-backup
index 0c2a1289a3..3c0be60e77 100755
--- a/sca-cpp/trunk/components/sqldb/pgsql-backup
+++ b/sca-cpp/trunk/components/sqldb/pgsql-backup
@@ -30,12 +30,20 @@ else
fi
pgsql_prefix=`cat $here/pgsql.prefix`
-$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('backup', true)" db 1>>$root/logs/postgresql 2>&1
+
+if [ -f "$root/sqldb/log.conf" ]; then
+ pgsql_log=`cat $root/sqldb/log.conf`
+else
+ mkdir -p $root/logs
+ pgsql_log="cat >>$root/logs/postgresql"
+fi
+
+$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_start_backup('backup', true)" db 2>&1 | $pgsql_log
echo "Content-type: application/x-compressed"
echo
tar -C $root/sqldb -cz data
-$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_stop_backup()" db 1>>$root/logs/postgresql 2>&1
+$pgsql_prefix/bin/psql -h $host -p $port -c "SELECT pg_stop_backup()" db 2>&1 | $pgsql_log