]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/make_catalog_backup.pl.in
Split messages line by line before sending it to syslog() fix #3325
[bacula/bacula] / bacula / src / cats / make_catalog_backup.pl.in
index fc0487e7f9745d3768386e65f8da0b98c4d13529..f955d93c2c78b8f9af0a411e94b2565682049fe9 100644 (file)
@@ -41,21 +41,10 @@ use strict;
 
 =cut
 
-$ENV{PATH}="@SQL_BINDIR@:$ENV{PATH}";
-
 my $cat = shift or die "Usage: $0 catalogname";
 my $dir_conf='@sbindir@/dbcheck -B -c @sysconfdir@/bacula-dir.conf';
 my $wd = "@working_dir@";
 
-sub dump_sqlite
-{
-    my %args = @_;
-
-    exec("echo .dump | sqlite '$wd/$args{db_name}.db' > '$wd/$args{db_name}.sql'");
-    print "Error while executing sqlite dump $!\n";
-    return 1;
-}
-
 sub dump_sqlite3
 {
     my %args = @_;
@@ -122,20 +111,21 @@ password=$args{db_password}
 sub dump_catalog
 {
     my %args = @_;
-    if ($args{db_type} eq 'SQLite') {
-        dump_sqlite(%args);
-    } elsif ($args{db_type} eq 'SQLite3') {
+    if ($args{db_type} eq 'SQLite3') {
+        $ENV{PATH}="@SQLITE_BINDIR@:$ENV{PATH}";
         dump_sqlite3(%args);
     } elsif ($args{db_type} eq 'PostgreSQL') {
+        $ENV{PATH}="@POSTGRESQL_BINDIR@:$ENV{PATH}";
         dump_pgsql(%args);
     } elsif ($args{db_type} eq 'MySQL') {
+        $ENV{PATH}="@MYSQL_BINDIR@:$ENV{PATH}";
         dump_mysql(%args);
     } else {
         die "This database type isn't supported";
     }
 }
 
-open(FP, "$dir_conf|") or die "Can't get catalog information $@";
+open(FP, "$dir_conf -C '$cat'|") or die "Can't get catalog information $@";
 # catalog=MyCatalog
 # db_type=SQLite
 # db_name=regress