: Cron job running at 12.00 AM despite changing its time I have only one cron configured in cPanel for WHMCS to run once per day at 12.00 AM. The cron sends daily activity logs to my email.
I have only one cron configured in cPanel for WHMCS to run once per day at 12.00 AM.
The cron sends daily activity logs to my email.
A problem came up recently in which cron job activity logs sent to me from that email noreply@yourdomain.com which does not exist. Emails are coming from that address without replacing my actual domain name.
So I deleted the cron job, I created a new one with different timing 8.00 AM. The cron runs correctly at that time and I'm receiving logs from my valid email. However, I still get emails at 12.00 AM too, as If there is another cron job stuck at that time and the logs are coming from that invalid email address noreply@yourdomain.com.
I looked into the cron configuration file and there were no duplicate entries for crons.
I checked with WHMCS support and the software configuration is correct.
Have anyone had a problem like this before? Any suggestions please? Thank you.
More posts by @Vandalay111
2 Comments
Sorted by latest first Latest Oldest Best
Also, when you check the cron jobs for every user, check the first few characters in each line of the cron file.
If the first set of characters start with either "0 0" or "00 00" or two sets of zeros in any form, then it means midnight. The later numbers help define how many midnights the task is supposed to happen. so if the remaining characters are space-separated stars followed by a command, then that command is executed every midnight (12 AM).
Also, check your crontabs before and after using cpanel (and especially after using cpanel), because cpanel is likely overwriting your crontab after saving settings (in cpanel). In a unix shell as root, you can switch users with this command:
su <insert username>
Then check and edit the crontab for that user like this:
crontab -e
also check the entire etc folder for other cron files that start with cron by typing:
ls /etc/cron*.*
Cron jobs can be installed in multiple locations. Make sure you check all of them. My server has a /etc/cron.d/ and /etc/cron.daily directory where cron jobs can be installed. Each user also can install jobs with the crontab command. (crontab -l will list all jobs for a particular user). You might want to try the solutions in this StackOverflow question about listing the cron jobs for all users.
When a cron job runs, a log entry gets posted to /etc/log/syslog that might look something like:
Jan 18 07:42:01 mybox CRON[26066]: (root) CMD (/root/cronjobs/check)
That could tell you when the job ran and with what user.
You could also try restarting the cron daemon with a command like:
sudo service cron restart
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.