troubleshooting Question

CentOS crontab doesn't work

Avatar of Daniele Brunengo
Daniele BrunengoFlag for Italy asked on
LinuxShell Scripting
13 Comments1 Solution345 ViewsLast Modified:
Hello, I'm trying to understand why the heck my CentOS server won't run crontab as it should. All other crons run just fine, but I have setup the system crontab as shown below. It should run backup.sh at midnight, but it doesn't.

This is the job definition in the /etc/crontab file

0 0 * * * root /home/backup.sh

Here's part of today's logs:

Mar 23 23:00:01 srvdati CROND[17331]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 23 23:01:01 srvdati CROND[17337]: (root) CMD (run-parts /etc/cron.hourly)
Mar 23 23:01:01 srvdati run-parts(/etc/cron.hourly)[17337]: starting 0anacron
Mar 23 23:01:01 srvdati run-parts(/etc/cron.hourly)[17346]: finished 0anacron
Mar 23 23:01:01 srvdati run-parts(/etc/cron.hourly)[17337]: starting mcelog.cron
Mar 23 23:01:01 srvdati run-parts(/etc/cron.hourly)[17365]: finished mcelog.cron
Mar 23 23:10:01 srvdati CROND[17506]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 23 23:20:01 srvdati CROND[17651]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 23 23:30:01 srvdati CROND[17795]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 23 23:40:01 srvdati CROND[17941]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 23 23:50:01 srvdati CROND[18087]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 23 23:53:01 srvdati CROND[18095]: (root) CMD (/usr/lib64/sa/sa2 -A)
Mar 24 00:00:01 srvdati CROND[18240]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 00:01:01 srvdati CROND[18246]: (root) CMD (run-parts /etc/cron.hourly)
Mar 24 00:01:01 srvdati run-parts(/etc/cron.hourly)[18246]: starting 0anacron
Mar 24 00:01:01 srvdati anacron[18258]: Anacron started on 2017-03-24
Mar 24 00:01:01 srvdati anacron[18258]: Jobs will be executed sequentially
Mar 24 00:01:01 srvdati anacron[18258]: Normal exit (0 jobs run)
Mar 24 00:01:01 srvdati run-parts(/etc/cron.hourly)[18260]: finished 0anacron
Mar 24 00:01:01 srvdati run-parts(/etc/cron.hourly)[18246]: starting mcelog.cron
Mar 24 00:01:01 srvdati run-parts(/etc/cron.hourly)[18279]: finished mcelog.cron
Mar 24 00:10:01 srvdati CROND[18420]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 00:20:01 srvdati CROND[18564]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 00:30:01 srvdati CROND[18709]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 00:40:01 srvdati CROND[18855]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 00:50:01 srvdati CROND[19000]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 01:00:01 srvdati CROND[19142]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 01:01:01 srvdati CROND[19150]: (root) CMD (run-parts /etc/cron.hourly)
Mar 24 01:01:02 srvdati run-parts(/etc/cron.hourly)[19150]: starting 0anacron
Mar 24 01:01:02 srvdati anacron[19162]: Anacron started on 2017-03-24
Mar 24 01:01:02 srvdati anacron[19162]: Jobs will be executed sequentially
Mar 24 01:01:02 srvdati anacron[19162]: Normal exit (0 jobs run)
Mar 24 01:01:02 srvdati run-parts(/etc/cron.hourly)[19164]: finished 0anacron
Mar 24 01:01:02 srvdati run-parts(/etc/cron.hourly)[19150]: starting mcelog.cron
Mar 24 01:01:02 srvdati run-parts(/etc/cron.hourly)[19183]: finished mcelog.cron
Mar 24 01:10:01 srvdati CROND[19262]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 01:20:01 srvdati CROND[19407]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 01:30:01 srvdati CROND[19553]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 01:40:01 srvdati CROND[19698]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Mar 24 01:50:01 srvdati CROND[19843]: (root) CMD (/usr/lib64/sa/sa1 1 1)

I have no emails in the root mailbox either, don't know what else to check.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 13 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros