Hi,
I'm using following Run After Job command to update the brestore tables
after each backup job in my bacula-dir.conf:
Run After Job = "/opt/local/sbin/brestore --conf /path/to/brestore.conf
--batch"
However, it looks like that the $HOME environment variable is not set
when running scripts under bacula like this on my system. I'm not sure
if it's because of bacula itself or Debian/Ubuntu's start-stop-daemon(8)
which might unset the variable before launching bacula-dir. What ever
the case might be, with $HOME missing, the following warning gets
printed
01-Oct 06:07 shakti-dir: AfterJob: Use of uninitialized value in concatenation
(.) or string at /opt/local/sbin/brestore line 3278.
and file .brestore.conf gets written to the root directory, which is not
nice at all. I think brestore should be more careful with $HOME. Here's
a patch after which brestore refuses to run if it can't autoset the
config file path using $HOME and if the config file was not specified on
the command line.
Thanks,
--
Tuomas Jormola <[EMAIL PROTECTED]>
--- bacula-gui-2.2.4.orig/brestore/brestore.pl 2007-08-20 19:42:55.000000000 +0300
+++ bacula-gui-2.2.4/brestore/brestore.pl 2007-10-01 23:36:33.112700200 +0300
@@ -3275,13 +3275,17 @@
exit 1;
}
-my $file_conf = "$ENV{HOME}/.brestore.conf" ;
+my $file_conf = exists $ENV{HOME} ? "$ENV{HOME}/.brestore.conf" : undef;
my $batch_mod;
GetOptions("conf=s" => \$file_conf,
"batch" => \$batch_mod,
"debug" => \$debug,
"help" => \&HELP_MESSAGE) ;
+if (!defined $file_conf) {
+ print STDERR "Could not detect default config file and no config file specified\n";
+ exit 1;
+}
my $p = new Pref($file_conf);
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Bacula-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-devel