System Administration
Showing results for 
Search instead for 
Do you mean 

Cron job does not want to stop

SOLVED
Go to Solution
Advisor

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
1 ACCEPTED SOLUTION
Highlighted
Acclaimed Contributor Acclaimed Contributor

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.
4 REPLIES
Highlighted
Acclaimed Contributor Acclaimed Contributor

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.
Advisor

Re: Cron job does not want to stop

Yeah, right.. Thank you
Advisor

Re: Cron job does not want to stop

I got my answer here :-)
Acclaimed Contributor Acclaimed Contributor

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