]> git.sur5r.net Git - bacula/bacula/commitdiff
ebl Cleanup postgresql part
authorEric Bollengier <eric@eb.homelinux.org>
Sun, 26 Oct 2008 13:43:41 +0000 (13:43 +0000)
committerEric Bollengier <eric@eb.homelinux.org>
Sun, 26 Oct 2008 13:43:41 +0000 (13:43 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7905 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/patches/testing/make_catalog_backup.pl.in

index 5d53e352c9c149b0c9f7f788b24426a830be3080..606890f9c0d39bb46d157d4b4e6a3c25cffbe971 100644 (file)
@@ -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