On Wed, 04 May 2011 13:23:55 +0200 Joris Heinrich <j...@malin-easy.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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/bacula-users