summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-07 03:52:02 +0000
committerlinuxpoet <linuxpoet@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-07 03:52:02 +0000
commit9a0585b4d49f4c15599980f7696ce7b2251c56ee (patch)
treeb066b1ad61c1e0826a58fa473f6dabe80787694b
parentc99d26f519720cef827dc4eda6932c2f6cca7a5a (diff)
adjust pg_commands to use password if available
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1036 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB/AM.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/LedgerSMB/AM.pm b/LedgerSMB/AM.pm
index e914b70d..d6d66984 100755
--- a/LedgerSMB/AM.pm
+++ b/LedgerSMB/AM.pm
@@ -1623,7 +1623,7 @@ sub backup {
my $suffix = "";
if ($form->{media} eq 'email') {
- print OUT `pg_dump -U $globalDBUserName -h $globalDBhost -Fc -p $globalDBport $globalDBname`;
+ print OUT `PGPASSWD="$globalDBPassword" pg_dump -U $globalDBUserName -h $globalDBhost -Fc -p $globalDBport $globalDBname`;
close OUT;
use LedgerSMB::Mailer;
$mail = new Mailer;
@@ -1650,7 +1650,7 @@ sub backup {
print OUT qq|Content-Type: application/file;\n| .
qq|Content-Disposition: attachment; filename="$myconfig->{dbname}-$form->{dbversion}-$t[5]$t[4]$t[3].sql$suffix"\n\n|;
- print OUT `pg_dump -U $globalDBUserName -h $globalDBhost -Fc -p $globalDBport $globalDBname`;
+ print OUT `PGPASSWD="$globalDBPassword" pg_dump -U $globalDBUserName -h $globalDBhost -Fc -p $globalDBport $globalDBname`;
}
unlink "$tmpfile";