Bacula-users

Re: [Bacula-users] error message in runbefore job

2011-05-04 08:42:57
Subject: Re: [Bacula-users] error message in runbefore job
From: Konstantin Khomoutov <flatworm AT users.sourceforge DOT net>
To: Joris Heinrich <jhn AT malin-easy DOT de>
Date: Wed, 4 May 2011 16:40:20 +0400
On Wed, 04 May 2011 13:23:55 +0200
Joris Heinrich <jhn AT malin-easy DOT de> wrote:

> i run an job with an mysql backup and an ClientRunBeforeJob like this
> example:
> 
> 
> Job {
>     Name                = test-client
>     Client              = tool-client
>     JobDefs             = dbdump
>     FileSet             = db
>     ClientRunBeforeJob  = "/etc/bacula/scripts/manage_mysql_backup"
> 
> In the client script, is included an ssh connect to various other
> machines. Some machines are new installed, and the host-verification
> will be fail:
> 
> 04-May 01:00 tool-client JobId 291204: ClientRunBeforeJob: Host key
> verification failed.
> 
> The bacula job it self brings an OK Message per email.
> 
> Now my qestion, it is possible to parse the message and change the
> job-status to error or warning..
Create another script, say,
/etc/bacula/scripts/manage_mysql_backup2
which should look like this:

#!/bin/sh
/etc/bacula/scripts/manage_mysql_backup 2>&1 \
  | grep "verification failed" && exit 1

Then use the new wrapper script for ClientRunBeforeJob.
Now if the original script generates that error message, the wrapper
script would exit with non-zero code, failing the job.

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Bacula-users mailing list
Bacula-users AT lists.sourceforge DOT net
https://lists.sourceforge.net/lists/listinfo/bacula-users