Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Crontab not processing entries

Status
Not open for further replies.
Oct 9, 2003
174
0
0
US
I am running Solaris 8 on a V880 sun server. for years, I have had these same entries setup in my crontab to run diferent jobs at different times throughout the day. Starting this morning for some reason the crontab under "root" is not processing entries anymore. However under the other users it is working.

I can also run the tasks under the root crontab manually with no issues.

Is there anything I can check to see why the root crontab is not processing jobs anymore? Maybe a deamon or something?

Thanks in advance
 
Check to see if the 'cron' daemon is running.
ps -ef | grep cron

There should be a process: /usr/sbin/cron that started at the same time as the system booted (check with who -b).

You can 'bounce' the cron daemon, if you want, with:
/etc/init.d/cron stop
/etc/init.d/cron start


I hope that helps.

Mike
 
Read man crontab.

Did some add a cron.allow or cron.deny?

The other possible reason is sometimes admins use the *LK* password entry in the shadow file. While this locks out the root, it also renders the account "invisible" to admin tools like cron.

I don't have cron source handy, but lots of utils use a call to "getvalidshell()", which simply matches the shell in /etc/passwd to /etc/shells. Make sure that root's shell is listed there, or isn't disabled.
 
It could be that the jobs themselves are having errors. Do you have logs to check? If you aren't collecting logs for the jobs, the output should be mailed to root. Check root's mail.

Also, a simple heartbeat cron job like this will confirm if it's running jobs...
Code:
* * * * * /bin/date >> date.log 2>&1
That will append a timestamp once every minute to date.log.

 
Thanks for the suggestions guys:

Mike042:

I checked and have the deamon running. I even bounced it to make sure, still nothing will run.

# ps -ef | grep cron
root 21473 1 0 14:42:36 ? 0:00 /usr/sbin/cron
root 22590 21389 0 15:07:31 pts/2 0:00 grep cron



Elgrandeperro:

- We do not have the *LK* in the shadow file for the root.
- Here is the listing of users in the cron.deny

# more cron.deny
daemon
bin
smtp
nuucp
listen
nobody
noaccess


Sam Bones:
We are doing that already. Plus if I copy any entry in the crontab file (minus the start date and time), then paste it at the command prompt I can run each entry without a problem.


It doesn't look like any of those suggestions worked guys. Anything else?



 
Does crontab -l (as root) spit out the file? Does the file have the correct EOF (crontab -l | od -c | more)
 
Just because the command will run at the command line, doesn't mean it will run in cron. Cron runs the command with a VERY minimal environment and possibly even a different shell than you're expecting.

Make sure you have a shebang line in your script and all necessary environment variables are either defined in the script, or sourced from [tt].profile[/tt] or some other script.

Again, have you found any logs from the cron jobs? That should give more clues. Or, is there no sign that they are running at all? That is, no logs at all.


 
Thanks for all you tips guys. When I tried to login the next day I was prompted for a password change. Apparantly the pw had expired. Stupid Me.....

I appreciate everyone's help!!!
 
Well, I think that is another case in which the account is ignored....if it has expired!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top