On Sun, Apr 03, 2011 at 07:21:43PM +0200, Christian Kastner wrote:
> On 01/-10/-28163 08:59 PM, Christian Andretzky wrote:
> > Hi,
> > until now we are using a /etc/crontab file which has some lines like the
> > following:
> > 
> > */10 * * * * root test -x /name/of/the/script && /name/of/the/script
> > 
> > In the past I had 2 ways If I don't want the script running:
> > 
> >  - I could remove the 'x' attribute from the (existing) script
> > and
> >  - I could remove (or not install) the script on the machine.
> > 
> > Now the second way does no longer work.

The second way still works, but now generates a log in cron. If you want to
avoid the log in cron you should have this instead:

*/10 * * * * root test ! -x /name/of/the/script || /name/of/the/script

This way the exit value is 0 either if:
    - the script does not exist
    - the script returns OK

If the script exists but does not work OK it will not return 0 and you will
get an error logged by cron.

Regards

Javier

Attachment: signature.asc
Description: Digital signature

Reply via email to