Bacula-users

[Bacula-users] Run client side script in admin jobs?

2011-02-18 04:21:38
Subject: [Bacula-users] Run client side script in admin jobs?
From: Jeremy Maes <jma AT schaubroeck DOT be>
To: bacula-users <bacula-users AT lists.sourceforge DOT net>
Date: Fri, 18 Feb 2011 10:17:50 +0100
Hey

I'm having some issues with running a script on the client, using an admin job. (Bacula 5.0.3 for all daemons, running on RHEL4.8)
There seems to be very little information regarding admin jobs and what you can or cannot do with them, but it seems that running a script on the client side doesn't work.
It never even tries running the script it seems.

Currently have this job defined:
Job {
  Name = "EmulateBKUpAllFP"
  Type = Admin
  RunScript {
    RunsOnClient = Yes
    RunsWhen = Before
    Command = "sudo /usr/local/bin/cleantapedb LTO-3"
  }
  Messages = OnError
  Pool = Default
  Storage = LTO-3-FP
  Client = hoegaarden-fd
  FileSet = "Full Linux Set FP"
  Schedule = "WeeklyCycleBeforeBackup"
  Priority = 9
}

The script it runs emulates an older backup script we used before bacula, and works like a charm locally everywhere, but it refuses to run from this admin job on server with a second SD and FD.
There is no output telling me bacula tries to run the script whatsoever, just an "OK"

17-Feb 20:50 hoegaardenapp-dir JobId 44: Start Admin JobId 44, Job=EmulateBKUpAllFP.2011-02-17_20.50.00_16
17-Feb 20:50 hoegaardenapp-dir JobId 44: Bacula 5.0.3 (30Aug10): 17-Feb-2011 20:50
  JobId:                  44
  Job:                    EmulateBKUpAllFP.2011-02-17_20.50.00_16
  Start time:             17-Feb-2011 20:50
  End time:               17-Feb-2011 20:50
  Termination:            Admin OK

Whereas the local version does output what I expect and mentions the running of the script:

17-Feb 20:50 hoegaardenapp-dir JobId 43: shell command: run BeforeJob "sudo /usr/local/bin/cleantapedb LTO-2"
17-Feb 20:50 hoegaardenapp-dir JobId 43: BeforeJob: Connecting to Director hoegaardenapp:9101

...

Running other scripts on the same remote client works without any issues from the regular daily backup job:
Job {
  Name = "Backuphoegaarden"
  JobDefs = "DefaultLinuxJob"
  FileSet = "Full Linux Set FP"
  Storage = LTO-3-FP
  Client = hoegaarden-fd
  Write Bootstrap = "/LOGGING/bacula/bootstraps/hoegaarden-%i.bsr"
  RunScript {
    RunsOnClient = Yes
    RunsWhen = Before
    FailJobOnError = No
    Command = "/usr/local/bin/export_mysql.sh"
  }
  RunScript {
    RunsOnClient = Yes
    RunsWhen = Before
    FailJobOnError = No
    Command = "/usr/local/bin/export_informix.sh"
  }
}

Both databases get exported on the remote machine as expected.

So on to the questions:
Can an admin job execute scripts on a client, or only locally? Are there any other restrictions to admin jobs? Or did I just make some stupid mistake? ^^
Another, related question: Does anyone know when exactly the "run before" scripts are executed? Mainly, are they executed before bacula mounts the storage, or are they executed after bacula mounts but before it actually uses the storage?
If it runs before a mount I could probably get away running my script as a run before script in the backupjob itself instead of using an admin job. Would also serve to lower the amount of jobs all of our clients see in their logs.


Kind regards,
Jeremy

**** DISCLAIMER ****
http://www.schaubroeck.be/maildisclaimer.htm

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users
<Prev in Thread] Current Thread [Next in Thread>