From: Eric Bollengier Date: Tue, 23 Feb 2010 13:53:38 +0000 (+0100) Subject: Use db_socket parameter in make_catalog_backup_.pl script X-Git-Tag: Release-5.2.1~1685 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3194f151d6186dc2681d95fe9138e95033bb7b40;p=bacula%2Fbacula Use db_socket parameter in make_catalog_backup_.pl script --- diff --git a/bacula/src/cats/make_catalog_backup.pl.in b/bacula/src/cats/make_catalog_backup.pl.in index f1e00e8ea0..bc606e8d57 100644 --- a/bacula/src/cats/make_catalog_backup.pl.in +++ b/bacula/src/cats/make_catalog_backup.pl.in @@ -14,7 +14,7 @@ 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. @@ -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} ";