]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/make_catalog_backup.pl.in
bat: Use BVFS on bRestore view
[bacula/bacula] / bacula / src / cats / make_catalog_backup.pl.in
index f1e00e8ea00ca38358b5336d43eda74568c4256b..9bb6b7c98f2451d9f55a6b39a928b901b83db3b4 100644 (file)
@@ -14,13 +14,13 @@ use strict;
 
    Bacula® - The Network Backup Solution
 
-   Copyright (C) 2000-2008 Free Software Foundation Europe e.V.
+   Copyright (C) 2000-2010 Free Software Foundation Europe e.V.
 
    The main author of Bacula is Kern Sibbald, with contributions from
    many others, a complete list can be found in the file AUTHORS.
 
    This program is Free Software; you can redistribute it and/or
-   modify it under the terms of version two of the GNU General Public
+   modify it under the terms of version three of the GNU Affero General Public
    License as published by the Free Software Foundation plus additions
    that are listed in the file LICENSE.
 
@@ -29,7 +29,7 @@ use strict;
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    General Public License for more details.
 
-   You should have received a copy of the GNU General Public License
+   You should have received a copy of the GNU Affero General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
@@ -74,6 +74,9 @@ sub dump_pgsql
     if ($args{db_address}) {
         $ENV{PGHOST}=$args{db_address};
     }
+    if ($args{db_socket}) {
+        $ENV{PGHOST}=$args{db_socket};
+    }
     if ($args{db_port}) {
         $ENV{PGPORT}=$args{db_port};
     }
@@ -93,9 +96,15 @@ sub dump_mysql
     unlink("$wd/.my.cnf");
     open(MY, ">$wd/.my.cnf") 
         or die "Can't open $wd/.my.cnf for writing $@";
+
     $args{db_address} = $args{db_address} || "localhost";
+    my $addr = "host=$args{db_address}";
+    if ($args{db_socket}) {     # unix socket is fastest than net socket
+        $addr = "socket=$args{db_socket}";
+    }
+
     print MY "[client]
-host=$args{db_address}
+$addr
 user=$args{db_user}
 password=$args{db_password}
 ";
@@ -126,7 +135,7 @@ sub dump_catalog
     }
 }
 
-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