Re: Cron job does not want to stop (376 Views)
Reply
Advisor
take2mir
Posts: 31
Registered: ‎09-24-2007
Message 1 of 5 (376 Views)
Accepted Solution

Cron job does not want to stop

Hi experts,
I really need your help. I had created cron job as below

#UTILIZATION CAPTURE
0 * * * * /usr/bin/sh /utilization/script

with this script

#!/bin/sh
sar -u 10 12 >> /utilization/sp2bm03cpu.txt
(date && vmstat) >> /utilization/sp2bm03mem.txt

However when I delete this cron job, it still keep producing the sp2bm03cpu.txt and xp2bm03mem.txt files. How should I do to make it stop?

TQ
Please use plain text.
Acclaimed Contributor
A. Clay Stephenson
Posts: 17,825
Registered: ‎07-16-1998
Message 2 of 5 (376 Views)

Re: Cron job does not want to stop

How are you deleteing the cron job? If you simply edit the files under /var/spool, you have done nothing because you have not changed cron's in memory paramters. The correct procedure is:
crontab -l > mycronfile
Next edit mycronfile and remove the desired entry. Finally, "crontab < mycronfile" which not only alters the files under /var/spool but also sends a SIGHUP to the cron daemon that tells it to reread its configuration files.
If it ain't broke, I can fix that.
Please use plain text.
Advisor
take2mir
Posts: 31
Registered: ‎09-24-2007
Message 3 of 5 (376 Views)

Re: Cron job does not want to stop

Yeah, right.. Thank you
Please use plain text.
Advisor
take2mir
Posts: 31
Registered: ‎09-24-2007
Message 4 of 5 (376 Views)

Re: Cron job does not want to stop

I got my answer here :-)
Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,849
Registered: ‎03-06-2006
Message 5 of 5 (376 Views)

Re: Cron job does not want to stop

>Clay: also sends a SIGHUP to the cron daemon that tells it to reread its configuration files.

No SIGHUPs here. It puts a message in the cron FIFO: /var/adm/cron/FIFO
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation