git-svn-id: http://code.autistici.org/svn/backupninja/trunk@453
758a04ac-41e6-0310-8a23-
8373a73cc35d
sys:
. Fixed typo breaking things for VServers.
. Fix bug when vrootdir is on its own partition (Closes: #395928)
sys:
. Fixed typo breaking things for VServers.
. Fix bug when vrootdir is on its own partition (Closes: #395928)
+ pgsql:
+ . Support configuring PGSQLUSER for real, and document it a bit
+ (Closes: #396578)
fixed automake 'make install' bug that failed if /etc/backup.d already
existed
fixed automake 'make install' bug that failed if /etc/backup.d already
existed
# compress = < yes | no > (default = yes)
# if yes, compress the pg_dump/pg_dumpall output.
# compress = < yes | no > (default = yes)
# if yes, compress the pg_dump/pg_dumpall output.
+### You can also set the following variables in /etc/backupninja.conf:
+# PGSQLDUMP: pg_dump path (default: /usr/bin/pg_dump)
+# PGSQLDUMPALL: pg_dumpall path (default: /usr/bin/pg_dumpall)
+# PGSQLUSER: user running PostgreSQL (default: postgres)
if [ $usevserver = yes ]; then
pguid=`$VSERVER $vsname exec getent passwd $PGSQLUSER | awk -F: '{print $3}'`
else
if [ $usevserver = yes ]; then
pguid=`$VSERVER $vsname exec getent passwd $PGSQLUSER | awk -F: '{print $3}'`
else
- pguid=`getent passwd postgres | awk -F: '{print $3}'`
+ pguid=`getent passwd $PGSQLUSER | awk -F: '{print $3}'`
- fatal "No user called postgres`[ $usevserver = no ] || echo \" on vserver $vsname\"`."
+ fatal "No user called $PGSQLUSER`[ $usevserver = no ] || echo \" on vserver $vsname\"`."
debug "chown $pguid $vroot$backupdir"
chown $pguid $vroot$backupdir
debug "chmod 700 $vroot$backupdir"
debug "chown $pguid $vroot$backupdir"
chown $pguid $vroot$backupdir
debug "chmod 700 $vroot$backupdir"
if [ "$databases" == "all" ]; then
if [ $usevserver = yes ]; then
if [ "$compress" == "yes" ]; then
if [ "$databases" == "all" ]; then
if [ $usevserver = yes ]; then
if [ "$compress" == "yes" ]; then
- execstr="$VSERVER $vsname exec su - postgres -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${vsname}.sql.gz\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${vsname}.sql.gz\""
- execstr="$VSERVER $vsname exec su - postgres -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\""
fi
else
if [ "$compress" == "yes" ]; then
fi
else
if [ "$compress" == "yes" ]; then
- execstr="su - postgres -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${localhost}-all.sql.gz\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP > $backupdir/${localhost}-all.sql.gz\""
- execstr="su - postgres -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\""
for db in $databases; do
if [ $usevserver = yes ]; then
if [ "$compress" == "yes" ]; then
for db in $databases; do
if [ $usevserver = yes ]; then
if [ "$compress" == "yes" ]; then
- execstr="$VSERVER $vsname exec su - postgres -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\""
- execstr="$VSERVER $vsname exec su - postgres -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\""
fi
else
if [ "$compress" == "yes" ]; then
fi
else
if [ "$compress" == "yes" ]; then
- execstr="su - postgres -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP > $backupdir/${db}.sql.gz\""
- execstr="su - postgres -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\""
# if yes, compress the pg_dump/pg_dumpall output.
$pgsql_compress
# if yes, compress the pg_dump/pg_dumpall output.
$pgsql_compress
+### You can also set the following variables in backupninja.conf:
+# PGSQLDUMP: pg_dump path (default: /usr/bin/pg_dump)
+# PGSQLDUMPALL: pg_dumpall path (default: /usr/bin/pg_dumpall)
+# PGSQLUSER: user running PostgreSQL (default: postgres)
+
EOF
chmod 600 $next_filename
EOF
chmod 600 $next_filename
getconf MYSQLDUMP /usr/bin/mysqldump
getconf PGSQLDUMP /usr/bin/pg_dump
getconf PGSQLDUMPALL /usr/bin/pg_dumpall
getconf MYSQLDUMP /usr/bin/mysqldump
getconf PGSQLDUMP /usr/bin/pg_dump
getconf PGSQLDUMPALL /usr/bin/pg_dumpall
+getconf PGSQLUSER postgres
getconf GZIP /bin/gzip
getconf RSYNC /usr/bin/rsync
getconf admingroup root
getconf GZIP /bin/gzip
getconf RSYNC /usr/bin/rsync
getconf admingroup root