Bacula-users

Re: [Bacula-users] Script for checking a client status

2009-04-30 03:24:56
Subject: Re: [Bacula-users] Script for checking a client status
From: Personal Técnico <tecnicos AT caos.uab DOT es>
To: bacula-users AT lists.sourceforge DOT net
Date: Thu, 30 Apr 2009 09:20:16 +0200
Hi,

> Why not something like 'echo "sta client=$1" | bconsole -c ... | grep 
> -q ...' and check the return code? Much simpler and uses less resources.
>   
executing it from command line (and from a script changing "client-fd"
by $1 using Run Before Job = "/etc/bacula/scripts/check-status-client.sh
'%c'"):

echo "sta client=client-fd" | bconsole | grep -q "Failed to connect to
Client" ; echo $?

I get value 1 if bacula can connect with client and value 0 is not, so
exit would be 1 if  OK and 0 if ERROR... correct??

>   
So this lines...
> In some document, I read if script exit with value different from 0 
> > would mean script had exited with error and job won't run (in other 
> > words, bacula would not try to connect with client).
are false...





------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations 
Conference from O'Reilly Media. Velocity features a full day of 
expert-led, hands-on workshops and two days of sessions from industry 
leaders in dedicated Performance & Operations tracks. Use code vel09scf 
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
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>