Skip to content
Snippets Groups Projects
Commit 198738d8 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

pgsql.backup - no subshell to fetch backup status

parent 468cadb7
No related branches found
No related tags found
1 merge request!150pgsql.backup - no subshell to fetch backup status
...@@ -56,7 +56,6 @@ function pgsql.backup(){ ...@@ -56,7 +56,6 @@ function pgsql.backup(){
# ----- GO # ----- GO
# prevent could not change directory to "/root": Permission denied # prevent could not change directory to "/root": Permission denied
(
cd /tmp cd /tmp
# Detect a readonly or writeable postgres host. # Detect a readonly or writeable postgres host.
...@@ -89,8 +88,8 @@ function pgsql.backup(){ ...@@ -89,8 +88,8 @@ function pgsql.backup(){
if [ $bUseSnapshot4DB -eq 1 ]; then if [ $bUseSnapshot4DB -eq 1 ]; then
echo -n " snapshot ... " echo -n " snapshot ... "
su ${PGUSER} -c "dropdb ${SNAPSHOTDB}" >/dev/null 2>&1 su ${PGUSER} -c "dropdb ${SNAPSHOTDB}" >/dev/null 2>&1
if ! su ${PGUSER} -c "psql ${BACKUP_PARAMS} -c \"CREATE DATABASE ${SNAPSHOTDB} WITH TEMPLATE ${DATABASE};\"" >/dev/null 2>&1; then if ! su ${PGUSER} -c "psql ${BACKUP_PARAMS} -c \"CREATE DATABASE ${SNAPSHOTDB} WITH TEMPLATE ${DATABASE};\"" >/dev/null; then
echo -n " nope, using origin ... " echo -n "Fallback using origin ... "
bUseSnapshot4DB=0 bUseSnapshot4DB=0
SNAPSHOTDB="${DATABASE}" SNAPSHOTDB="${DATABASE}"
fi fi
...@@ -115,7 +114,7 @@ function pgsql.backup(){ ...@@ -115,7 +114,7 @@ function pgsql.backup(){
fi fi
done done
) cd - >/dev/null
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment