Operating System - HP-UX
1836504 Members
2046 Online
110101 Solutions
New Discussion

Re: A user cron job still runs after deletion and reboot

 
Haitham Hamad
Regular Advisor

A user cron job still runs after deletion and reboot

A user cron was deleted from /var/spool/cron/crontabs directory but it still runs at the specified time??how can I stop that?
8 REPLIES 8
Dario_1
Trusted Contributor

Re: A user cron job still runs after deletion and reboot

Can you see the cronjob when doing a crontab -l? If yes, do a crontab -e and delete the line or do that using sam. Is that machine part of a Service Guard Cluster?

Regards,

DR
Ron Cornwell
Trusted Contributor

Re: A user cron job still runs after deletion and reboot

1. Check to make sure that it is not launch from another crontab entry (from root with an su).
2. Make sure you take the user out of /var/adm/cron/cron.allow.
3. Ensure the the job running is a cron job and not an 'at' job.
James R. Ferguson
Acclaimed Contributor

Re: A user cron job still runs after deletion and reboot

Hi:

# crontab -r

Regards!

...JRF...
Haitham Hamad
Regular Advisor

Re: A user cron job still runs after deletion and reboot

the strange situtation is that
1- The use is not in cron.allow file and therefore when he runs crontab -l, he gets an unallowed message
2-the user still gets email whenever the cron runs!!
3- there is no su for that job in root's cron
Haitham Hamad
Regular Advisor

Re: A user cron job still runs after deletion and reboot

crontab -r for the user gets
crontab: you are not authorized to use cron. Sorry.
Dario_1
Trusted Contributor

Re: A user cron job still runs after deletion and reboot

As mentioned by Ron, check the cron jobs executed by root to see an su to that user is getting executed from one of the root's crontjobs.

Regards,

DR
Haitham Hamad
Regular Advisor

Re: A user cron job still runs after deletion and reboot

I thought I would add the user back to cron.allow and then run the crontab -r command. When I added the user, I ran the crontab -l command and the cron job is there. I removed it with crontab -r. I don't think it will show up again. thanks everyone
Frank Slootweg
Honored Contributor

Re: A user cron job still runs after deletion and reboot

The problem is solved, but I just wanted to let you know *why* you got the problem:

cron(1M) keeps in-memory copies of the crontabs, so you should *not* delete/add/change files in/to the /var/spool/cron/crontabs directory, but use the crontab(1) command deleting/adding/changing crontab entries.