From f5f932b514cb7c676df9ca5b962c90d827e67b6a Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Sun, 26 Oct 2008 13:43:41 +0000 Subject: [PATCH] ebl Cleanup postgresql part git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7905 91ce42f0-d328-0410-95d8-f526ca767f89 --- .../patches/testing/make_catalog_backup.pl.in | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/bacula/patches/testing/make_catalog_backup.pl.in b/bacula/patches/testing/make_catalog_backup.pl.in index 5d53e352c9..606890f9c0 100644 --- a/bacula/patches/testing/make_catalog_backup.pl.in +++ b/bacula/patches/testing/make_catalog_backup.pl.in @@ -42,7 +42,7 @@ use strict; =cut my $cat = shift or die "Usage: $0 catalogname"; -my $dir='@sbindir@/bacula-dir -B -c @sysconfdir@/bacula-dir.conf'; +my $dir_conf='@sbindir@/dbcheck -B -c @sysconfdir@/bacula-dir.conf'; my $wd = "@working_dir@"; sub dump_sqlite @@ -68,28 +68,18 @@ sub dump_pgsql { my %args = @_; umask(0077); - unlink("$wd/pg_service.conf"); - open(PG, ">$wd/pg_service.conf") - or die "Can't open $wd/pg_service.conf for writing $@"; - print PG "[bacula] -dbname=$args{db_name} -user=$args{db_user} -password=$args{db_password} -"; + if ($args{db_address}) { - print PG "address=$args{db_address}\n"; $ENV{PGHOST}=$args{db_address}; } if ($args{db_port}) { - print PG "port=$args{db_port}\n"; $ENV{PGPORT}=$args{db_port}; } - - close(PG); + $ENV{PGDATABASE}=$args{db_name}; $ENV{PGUSER}=$args{db_user}; $ENV{PGPASSWORD}=$args{db_password}; - exec("HOME='$wd' PGSERVICE=bacula PGSYSCONFDIR='$wd' pg_dump -c > '$wd/$args{db_name}.sql'"); + exec("HOME='$wd' pg_dump -c > '$wd/$args{db_name}.sql'"); print "Error while executing postgres dump $!\n"; return 1; # in case of error } @@ -134,7 +124,7 @@ sub dump_catalog } } -open(FP, "$dir|") or die "Can't get catalog information $@"; +open(FP, "$dir_conf|") or die "Can't get catalog information $@"; # catalog=MyCatalog # db_type=SQLite # db_name=regress -- 2.39.5