aboutsummaryrefslogtreecommitdiff
path: root/handlers/pgsql.in
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2009-12-25 02:33:13 +0100
committerintrigeri <intrigeri@boum.org>2009-12-25 02:33:13 +0100
commitf4ab3148f175f8ac415b01fea61d14a80f4de969 (patch)
tree016ed43a30dfd15ef6e2e3df26f4161e52e6c57b /handlers/pgsql.in
parent5da707b309c08de3fa7d3792d98f337eb5169141 (diff)
downloadbackupninja-f4ab3148f175f8ac415b01fea61d14a80f4de969.tar.gz
backupninja-f4ab3148f175f8ac415b01fea61d14a80f4de969.tar.bz2
mysql, pgsql: Quote output filenames
... to support shell meta-characters in database names. Closes Redmine bug #617.
Diffstat (limited to 'handlers/pgsql.in')
-rw-r--r--handlers/pgsql.in16
1 files changed, 8 insertions, 8 deletions
diff --git a/handlers/pgsql.in b/handlers/pgsql.in
index a7e3ec2..d7839fb 100644
--- a/handlers/pgsql.in
+++ b/handlers/pgsql.in
@@ -75,15 +75,15 @@ chmod 700 $vroot$backupdir
if [ "$databases" == "all" ]; then
if [ $usevserver = yes ]; then
if [ "$compress" == "yes" ]; then
- execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > $backupdir/${vsname}.sql.gz\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${vsname}.sql.gz'\""
else
- execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${vsname}.sql\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${vsname}.sql'\""
fi
else
if [ "$compress" == "yes" ]; then
- execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > $backupdir/${localhost}-all.sql.gz\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL | $GZIP --rsyncable > '$backupdir/${localhost}-all.sql.gz'\""
else
- execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > $backupdir/${localhost}-all.sql\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMPALL > '$backupdir/${localhost}-all.sql'\""
fi
fi
debug "$execstr"
@@ -104,15 +104,15 @@ else
for db in $databases; do
if [ $usevserver = yes ]; then
if [ "$compress" == "yes" ]; then
- execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > $backupdir/${db}.sql.gz\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\""
else
- execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > $backupdir/${db}.sql\""
+ execstr="$VSERVER $vsname exec su - $PGSQLUSER -c \"$PGSQLDUMP $db | > '$backupdir/${db}.sql'\""
fi
else
if [ "$compress" == "yes" ]; then
- execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > $backupdir/${db}.sql.gz\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db | $GZIP --rsyncable > '$backupdir/${db}.sql.gz'\""
else
- execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > $backupdir/${db}.sql\""
+ execstr="su - $PGSQLUSER -c \"$PGSQLDUMP $db > '$backupdir/${db}.sql'\""
fi
fi
debug "$execstr"