[SOLVED] cron.monthly not running - everything else is
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am having an issue in Red Hat 6.3 where cron.monthly is not being run - the others all are but cron.monthly is not.
Looking at the logfile I can see that the others all are all being run but there is no entry in the logfile showing cron.monthly. There is an entry for cron.weekly which is empty, but none for cron.monthly.
I am wondering if the @monthly macro in my anacrontab needs to be set somewhere?
Here is a copy of the anacrontab:
Code:
# /etc/anacrontab: configuration file for anacron
# See anacron(8) and anacrontab(5) for details.
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
# the maximal random delay added to the base delay of the jobs
RANDOM_DELAY=45
# the jobs will be started during the following hours only
START_HOURS_RANGE=3-22
#period in days delay in minutes job-identifier command
1 5 cron.daily nice run-parts /etc/cron.daily
7 25 cron.weekly nice run-parts /etc/cron.weekly
@monthly 45 cron.monthly nice run-parts /etc/cron.monthly
cron logfile for 00:00 to 06:00 on 1st May:
Code:
May 1 00:00:01 spvx10599 CROND[10856]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 00:01:01 spvx10599 CROND[10948]: (root) CMD (run-parts /etc/cron.hourly)
May 1 00:01:01 spvx10599 run-parts(/etc/cron.hourly)[10948]: starting 0anacron
May 1 00:01:01 spvx10599 anacron[10961]: Anacron started on 2013-05-01
May 1 00:01:01 spvx10599 run-parts(/etc/cron.hourly)[10963]: finished 0anacron
May 1 00:01:01 spvx10599 anacron[10961]: Jobs will be executed sequentially
May 1 00:01:01 spvx10599 anacron[10961]: Normal exit (0 jobs run)
May 1 00:01:01 spvx10599 run-parts(/etc/cron.hourly)[10948]: starting mcelog.cron
May 1 00:01:01 spvx10599 run-parts(/etc/cron.hourly)[10971]: finished mcelog.cron
May 1 00:10:02 spvx10599 CROND[11984]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 00:20:01 spvx10599 CROND[13143]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 00:30:01 spvx10599 CROND[14228]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 00:40:01 spvx10599 CROND[15337]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 00:50:01 spvx10599 CROND[16494]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 01:00:01 spvx10599 CROND[17648]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 01:01:01 spvx10599 CROND[17784]: (root) CMD (run-parts /etc/cron.hourly)
May 1 01:01:01 spvx10599 run-parts(/etc/cron.hourly)[17784]: starting 0anacron
May 1 01:01:01 spvx10599 anacron[17796]: Anacron started on 2013-05-01
May 1 01:01:01 spvx10599 anacron[17796]: Jobs will be executed sequentially
May 1 01:01:01 spvx10599 anacron[17796]: Normal exit (0 jobs run)
May 1 01:01:01 spvx10599 run-parts(/etc/cron.hourly)[17798]: finished 0anacron
May 1 01:01:01 spvx10599 run-parts(/etc/cron.hourly)[17784]: starting mcelog.cron
May 1 01:01:01 spvx10599 run-parts(/etc/cron.hourly)[17807]: finished mcelog.cron
May 1 01:10:01 spvx10599 CROND[18768]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 01:20:02 spvx10599 CROND[19835]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 01:30:01 spvx10599 CROND[20889]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 01:40:01 spvx10599 CROND[21910]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 01:50:01 spvx10599 CROND[22985]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 02:00:01 spvx10599 CROND[24028]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 02:01:01 spvx10599 CROND[24122]: (root) CMD (run-parts /etc/cron.hourly)
May 1 02:01:01 spvx10599 run-parts(/etc/cron.hourly)[24122]: starting 0anacron
May 1 02:01:02 spvx10599 anacron[24134]: Anacron started on 2013-05-01
May 1 02:01:02 spvx10599 anacron[24134]: Jobs will be executed sequentially
May 1 02:01:02 spvx10599 anacron[24134]: Normal exit (0 jobs run)
May 1 02:01:02 spvx10599 run-parts(/etc/cron.hourly)[24136]: finished 0anacron
May 1 02:01:02 spvx10599 run-parts(/etc/cron.hourly)[24122]: starting mcelog.cron
May 1 02:01:02 spvx10599 run-parts(/etc/cron.hourly)[24144]: finished mcelog.cron
May 1 02:10:01 spvx10599 CROND[25108]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 02:20:01 spvx10599 CROND[26182]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 02:30:01 spvx10599 CROND[27241]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 02:40:01 spvx10599 CROND[28264]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 02:50:01 spvx10599 CROND[29391]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 03:00:01 spvx10599 CROND[30450]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 03:01:01 spvx10599 CROND[30591]: (root) CMD (run-parts /etc/cron.hourly)
May 1 03:01:01 spvx10599 run-parts(/etc/cron.hourly)[30591]: starting 0anacron
May 1 03:01:01 spvx10599 anacron[30616]: Anacron started on 2013-05-01
May 1 03:01:01 spvx10599 anacron[30616]: Will run job `cron.daily' in 21 min.
May 1 03:01:01 spvx10599 anacron[30616]: Will run job `cron.weekly' in 41 min.
May 1 03:01:01 spvx10599 anacron[30616]: Jobs will be executed sequentially
May 1 03:01:01 spvx10599 run-parts(/etc/cron.hourly)[30618]: finished 0anacron
May 1 03:01:01 spvx10599 run-parts(/etc/cron.hourly)[30591]: starting mcelog.cron
May 1 03:01:01 spvx10599 run-parts(/etc/cron.hourly)[30633]: finished mcelog.cron
May 1 03:10:01 spvx10599 CROND[31577]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 03:20:01 spvx10599 CROND[32715]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 03:22:01 spvx10599 anacron[30616]: Job `cron.daily' started
May 1 03:22:01 spvx10599 run-parts(/etc/cron.daily)[389]: starting 00webalizer
May 1 03:22:02 spvx10599 run-parts(/etc/cron.daily)[406]: finished 00webalizer
May 1 03:22:02 spvx10599 run-parts(/etc/cron.daily)[389]: starting 0logwatch
May 1 03:22:09 spvx10599 run-parts(/etc/cron.daily)[771]: finished 0logwatch
May 1 03:22:09 spvx10599 run-parts(/etc/cron.daily)[389]: starting certwatch
May 1 03:22:09 spvx10599 run-parts(/etc/cron.daily)[782]: finished certwatch
May 1 03:22:09 spvx10599 run-parts(/etc/cron.daily)[389]: starting cups
May 1 03:22:09 spvx10599 run-parts(/etc/cron.daily)[789]: finished cups
May 1 03:22:09 spvx10599 run-parts(/etc/cron.daily)[389]: starting logrotate
May 1 03:22:10 spvx10599 run-parts(/etc/cron.daily)[796]: finished logrotate
May 1 03:22:10 spvx10599 run-parts(/etc/cron.daily)[389]: starting makewhatis.cron
May 1 03:22:11 spvx10599 run-parts(/etc/cron.daily)[926]: finished makewhatis.cron
May 1 03:22:11 spvx10599 run-parts(/etc/cron.daily)[389]: starting mlocate.cron
May 1 03:22:22 spvx10599 run-parts(/etc/cron.daily)[957]: finished mlocate.cron
May 1 03:22:22 spvx10599 run-parts(/etc/cron.daily)[389]: starting prelink
May 1 03:22:22 spvx10599 run-parts(/etc/cron.daily)[969]: finished prelink
May 1 03:22:22 spvx10599 run-parts(/etc/cron.daily)[389]: starting readahead.cron
May 1 03:22:22 spvx10599 run-parts(/etc/cron.daily)[981]: finished readahead.cron
May 1 03:22:22 spvx10599 run-parts(/etc/cron.daily)[389]: starting rhsmd
May 1 03:22:24 spvx10599 run-parts(/etc/cron.daily)[1014]: finished rhsmd
May 1 03:22:24 spvx10599 run-parts(/etc/cron.daily)[389]: starting tapsprodlx64_audit_file_cleanup
May 1 03:22:24 spvx10599 run-parts(/etc/cron.daily)[1111]: finished tapsprodlx64_audit_file_cleanup
May 1 03:22:24 spvx10599 run-parts(/etc/cron.daily)[389]: starting timeresync
May 1 03:22:35 spvx10599 run-parts(/etc/cron.daily)[1121]: finished timeresync
May 1 03:22:35 spvx10599 run-parts(/etc/cron.daily)[389]: starting tmpwatch
May 1 03:22:35 spvx10599 run-parts(/etc/cron.daily)[1160]: finished tmpwatch
May 1 03:22:35 spvx10599 anacron[30616]: Job `cron.daily' terminated
May 1 03:30:01 spvx10599 CROND[2138]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 03:40:01 spvx10599 CROND[3507]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 03:42:11 spvx10599 anacron[30616]: Job `cron.weekly' started
May 1 03:42:11 spvx10599 anacron[30616]: Job `cron.weekly' terminated
May 1 03:42:11 spvx10599 anacron[30616]: Normal exit (2 jobs run)
May 1 03:50:01 spvx10599 CROND[4746]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 04:00:01 spvx10599 CROND[5862]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 04:01:01 spvx10599 CROND[5964]: (root) CMD (run-parts /etc/cron.hourly)
May 1 04:01:01 spvx10599 run-parts(/etc/cron.hourly)[5964]: starting 0anacron
May 1 04:01:01 spvx10599 run-parts(/etc/cron.hourly)[5973]: finished 0anacron
May 1 04:01:01 spvx10599 run-parts(/etc/cron.hourly)[5964]: starting mcelog.cron
May 1 04:01:01 spvx10599 run-parts(/etc/cron.hourly)[5984]: finished mcelog.cron
May 1 04:10:02 spvx10599 CROND[6954]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 04:10:02 spvx10599 CROND[6953]: (root) CMD (/usr/share/spamassassin/sa-update.cron 2>&1 | tee -a /var/log/sa-update.log)
May 1 04:20:01 spvx10599 CROND[8042]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 04:30:01 spvx10599 CROND[9083]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 04:40:01 spvx10599 CROND[10104]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 04:50:02 spvx10599 CROND[11192]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 05:00:01 spvx10599 CROND[12253]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 05:01:01 spvx10599 CROND[12344]: (root) CMD (run-parts /etc/cron.hourly)
May 1 05:01:01 spvx10599 run-parts(/etc/cron.hourly)[12344]: starting 0anacron
May 1 05:01:01 spvx10599 run-parts(/etc/cron.hourly)[12353]: finished 0anacron
May 1 05:01:01 spvx10599 run-parts(/etc/cron.hourly)[12344]: starting mcelog.cron
May 1 05:01:01 spvx10599 run-parts(/etc/cron.hourly)[12361]: finished mcelog.cron
May 1 05:10:01 spvx10599 CROND[13296]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 05:20:01 spvx10599 CROND[14396]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 05:30:02 spvx10599 CROND[15425]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 05:40:01 spvx10599 CROND[16437]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 05:50:01 spvx10599 CROND[17526]: (root) CMD (/usr/lib64/sa/sa1 1 1)
May 1 06:00:01 spvx10599 CROND[18675]: (root) CMD (/usr/lib64/sa/sa1 1 1)
Does anyone have an idea as to what is causing this problem?
I am wondering if the @monthly macro in my anacrontab needs to be set somewhere?
No and the entry looks OK to me.
Quote:
Originally Posted by Stannley
Does anyone have an idea as to what is causing this problem?
Are there actually any cron jobs in /etc/cron.monthly/?
Cron emails errors so did you check (the email account of the unprivileged user who should receive) root email?
Are there actually any cron jobs in /etc/cron.monthly/?
Yes, there are two jobs, one of them has a file extension, the other not, however cron.weekly is empty and that still appears in the logfile so I would at least expect to see the monthly one in there too.
Quote:
Originally Posted by unSpawn
Cron emails errors so did you check (the email account of the unprivileged user who should receive) root email?
I usually keep errors of this nature but can't find any from 1st May so I have to believe that I didn't receive any. I have received other cron errors in the past (although I am not sure if I have from this server), and I do receive the logwatch emails so I don't think there are any errors in the email setup.
Can you check from previous logs if cron.monthly ever ran before and if it's logged elsewhere like /var/log/audit/audit.log? And ownership / perms on /etc/cron.monthly and its contents?
Can you check from previous logs if cron.monthly ever ran before and if it's logged elsewhere like /var/log/audit/audit.log? And ownership / perms on /etc/cron.monthly and its contents?
Ok, this is odd. I grepped the cron logs and found that cron.monthly ran successfully today (10th) and also on April 10th, but it has never run before that (this machine has been up and running continuously since before Christmas, except for a restart on 1st April).
So, it appears that its running on every 10th of the month, which seems a little strange! Is there a way I can reset it to run on the 1st of every month?
Sorry to bump an old thread, but I had a similar question and found an answer. Anacron keeps track of the last time cron.daily/weekly/monthly were run. There are small files with just the last date in /var/spool/anacron. So, assuming your system is up 24/7, edit /var/spool/anacon/cron.monthly to hold the date of the previous first of the month. So if it is the middle of October, 2016, set the file to read 20161001. Then when the 1st of November rolls around, the @monthly will kick in and run it on 11-1 and update the file accordingly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.