From f96049caa6357ec58ed4bce0b87684b8d66a64d3 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Fri, 8 Mar 2024 11:43:34 +0100 Subject: [PATCH] update pgsql + couchdb scripts --- plugins/localdump/couchdb2.sh | 2 +- plugins/localdump/pgsql.sh | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/localdump/couchdb2.sh b/plugins/localdump/couchdb2.sh index 2976f29..50b531a 100755 --- a/plugins/localdump/couchdb2.sh +++ b/plugins/localdump/couchdb2.sh @@ -514,7 +514,7 @@ rc=$rc+$? if [ $rc -eq 0 ]; then - echo OK: couchdb2 config was found on this system ... checking requirements for backup ... + # echo OK: couchdb2 config was found on this system ... checking requirements for backup ... j_requireBinary "curl" 1 j_requireBinary "couchbackup" 1 diff --git a/plugins/localdump/pgsql.sh b/plugins/localdump/pgsql.sh index cff5ec1..fd2efe6 100755 --- a/plugins/localdump/pgsql.sh +++ b/plugins/localdump/pgsql.sh @@ -55,11 +55,11 @@ function doPgsqlBackup(){ # prevent could not change directory to "/root": Permission denied cd /tmp sSqlGetDblist="select datname from pg_database where not datistemplate and datallowconn order by datname;" - for DATABASE in $(su ${PGUSER} -c "psql -At -c '$sSqlGetDblist' postgres" 2>/dev/null) + for DATABASE in $(su ${PGUSER} -c "psql ${BACKUP_PARAMS} -At -c '$sSqlGetDblist' postgres" 2>/dev/null) do echo -n "__DB__${SERVICENAME} backup $DATABASE ... " OUTFILE="${BACKUP_TARGETDIR}/$(get_outfile ${DATABASE}).sql" - su ${PGUSER} -c "pg_dump -Fp ${DATABASE} >$OUTFILE" + su ${PGUSER} -c "pg_dump ${BACKUP_PARAMS} -Fp ${DATABASE} >$OUTFILE" fetchrc >/dev/null db._compressDumpfile "$OUTFILE" @@ -95,7 +95,7 @@ function restoreByFile(){ h2 "ensure that database exists ..." color cmd - su ${PGUSER} -c "psql -c \"CREATE DATABASE ${sMyDb};\"" + su ${PGUSER} -c "psql ${BACKUP_PARAMS} -c \"CREATE DATABASE ${sMyDb};\"" fetchrc color reset @@ -103,7 +103,7 @@ function restoreByFile(){ ls -l "${sMyfile}" echo "import to database [${sMyDb}]" color cmd - zcat "${sMyfile}" | su ${PGUSER} -c "psql -d ${sMyDb}" + zcat "${sMyfile}" | su ${PGUSER} -c "psql ${BACKUP_PARAMS} -d ${sMyDb}" fetchrc color reset -- GitLab