Date: Tue, 12 Aug 97 16:10:03 -0800 From: "Studded" <Studded@dal.net> To: "Lee Crites (AEI)" <leec@adam.adonai.net> Cc: "FreeBSD Questions" <FreeBSD-Questions@FreeBSD.ORG> Subject: Re: Possible cron bug Message-ID: <199708122310.QAA11168@mail.san.rr.com>
next in thread | raw e-mail | index | archive | help
On Mon, 11 Aug 1997 21:14:44 -0500 (CDT), Lee Crites (AEI) wrote: >On Mon, 11 Aug 1997, Studded wrote: > >=>#!/bin/sh >=> >=>/bin/ps -ax | /usr/bin/grep [a]djkerntz >=> >=>if [ $? != 0 ]; then >=> /sbin/adjkerntz -i & > ^^^ >=>fi >=> >=>exit > >Add the "&" as I put above. What is happening is the cron job itself is >hanging around until adjkerntz exits. Telling it to execute in the >background (via the '&') allows the shell script to complete, thus >making the two (not really) zombie tasks also go away. Sorry I wasn't more clear in my first post. I did try this script with a & as you have it here, and got the exact same results. >You could also use the -c option to grep, like this: > >#!/bin/csh -f >if ( "`/bin/ps -ax | /usr/bin/grep -c [a]djkerntz`" == "0") then > /sbin/adjkerntz -i & > endif > >I personally like the count option better, but everyone has his/her own >quirks... That's a good idea, I'll give it a go. :) Thanks for the tips, Doug Do thou amend they face, and I'll amend my life. -Shakespeare, "Henry V"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199708122310.QAA11168>