-1

I created a dummy entry in /etc/crontab, but it doesn't get executed according to the cron log: /var/log/cron:

Feb  7 08:20:01 localhost CROND[22781]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Feb  7 08:30:01 localhost CROND[23132]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Feb  7 08:40:01 localhost CROND[23137]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Feb  7 08:50:01 localhost CROND[23147]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Feb  7 09:00:01 localhost CROND[23922]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Feb  7 09:01:01 localhost CROND[23977]: (root) CMD (run-parts /etc/cron.hourly)
Feb  7 09:01:01 localhost run-parts(/etc/cron.hourly)[23977]: starting 0anacron
Feb  7 09:01:01 localhost run-parts(/etc/cron.hourly)[23986]: finished 0anacron
Feb  7 09:10:01 localhost CROND[24264]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Feb  7 09:20:01 localhost CROND[24295]: (root) CMD (/usr/lib64/sa/sa1 1 1)

/etc/crontab:

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# For details see man 4 crontabs

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# |  |  |  |  |
# *  *  *  *  * user-name command to be executed

05 20 * * * root /data/CENTRAL_BACKUP/xxx.sh

The OS is Centos.

2

Your cron job is set to be executed at 20 hour 5 minutes (24 hour format). And the log you provide is from 9 a clock. So you should wait till 20h to see it in the log.

And do not enter leading zeroes, this is not good practice, make your record like:

5 20 * * * root /data/CENTRAL_BACKUP/xxx.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.