Link to home
Create AccountLog in
Avatar of RGNCM Expert
RGNCM Expert

asked on

CRON does not run

Hello, all!
I have a crontab file with
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
45 * * * * root /sbin/shutdown -r now
The crond is running: I checked it with chkconfig --list | grep crond
it returns all:
crond 0:off 1:off 2:on 3:on 4:on 5:on 6:off
But the crontab -l says:
no crontab for root

Any idea where to look?

Thanks

ASKER CERTIFIED SOLUTION
Avatar of rysic
rysic
Flag of Poland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Avatar of omarfarid
omarfarid
Flag of United Arab Emirates image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of RGNCM Expert
RGNCM Expert

ASKER

Thank you Guys!
BTW: I am in Centos 5 and could not figure out the VI editor.  
I fixed this by creating a crontab file using the emacs editor and save it as "root" in the /var/spool/cron/.
The commands:
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

XX * * * * /sbin/shutdown -r now

executes fine, still do not create the mail.  I am looking into this now.
You could have set

EDITOR=emacs ; export EDITOR

Try to

export MAILTO

Look into your crontab man page to see if MAILTO is supported.

You can check crontab logs or you may run mail or mailx to check if messages are sent to root