|
@@ -356,9 +356,9 @@ dbdump () {
|
|
for db in $1 ; do
|
|
for db in $1 ; do
|
|
if [ -n "$SU_USERNAME" ]; then
|
|
if [ -n "$SU_USERNAME" ]; then
|
|
if [ "$db" = "$GLOBALS_OBJECTS" ]; then
|
|
if [ "$db" = "$GLOBALS_OBJECTS" ]; then
|
|
- su $SU_USERNAME -l -c "pg_dumpall $PGHOST --globals-only" >> $2
|
|
|
|
|
|
+ su - $SU_USERNAME -l -c "pg_dumpall $PGHOST --globals-only" >> $2
|
|
else
|
|
else
|
|
- su $SU_USERNAME -l -c "pg_dump $PGHOST $OPT $db" >> $2
|
|
|
|
|
|
+ su - $SU_USERNAME -l -c "pg_dump $PGHOST $OPT $db" >> $2
|
|
fi
|
|
fi
|
|
else
|
|
else
|
|
if [ "$db" = "$GLOBALS_OBJECTS" ]; then
|
|
if [ "$db" = "$GLOBALS_OBJECTS" ]; then
|
|
@@ -453,7 +453,7 @@ fi
|
|
# If backing up all DBs on the server
|
|
# If backing up all DBs on the server
|
|
if [ "$DBNAMES" = "all" ]; then
|
|
if [ "$DBNAMES" = "all" ]; then
|
|
if [ -n "$SU_USERNAME" ]; then
|
|
if [ -n "$SU_USERNAME" ]; then
|
|
- DBNAMES="$(su $SU_USERNAME -l -c "LANG=C psql -U $USERNAME $PGHOST -l -A -F: | sed -ne '/:/ { /Name:Owner/d; /template0/d; s/:.*$//; p }'")"
|
|
|
|
|
|
+ DBNAMES="$(su - $SU_USERNAME -l -c "LANG=C psql -U $USERNAME $PGHOST -l -A -F: | sed -ne '/:/ { /Name:Owner/d; /template0/d; s/:.*$//; p }'")"
|
|
else
|
|
else
|
|
DBNAMES="`LANG=C psql -U $USERNAME $PGHOST -l -A -F: | sed -ne "/:/ { /Name:Owner/d; /template0/d; s/:.*$//; p }"`"
|
|
DBNAMES="`LANG=C psql -U $USERNAME $PGHOST -l -A -F: | sed -ne "/:/ { /Name:Owner/d; /template0/d; s/:.*$//; p }"`"
|
|
fi
|
|
fi
|