User cron jobs doesn't run
I'm setting up a new WHM/cPanel server and when I created a few cron jobs for a cPanel user I noticed they didn't run. I setup a cron job to run every minute:
* * * * * php /home/domain/domains/domain.se/cli/garbagecron.php
And then I tailed /var/log/cron to see what was happening, and not much happend. This is all I got:
I tried restarting crond also but that didn't help. Anyone know what might be the problem?
Sep 25 15:25:01 server crond[481]: (domain) RELOAD (/var/spool/cron/domain)
Sep 25 15:37:16 server crond[211533]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 10% if used.)
Sep 25 15:37:16 server crond[211533]: (CRON) bad hour (/etc/cron.d/lvemanager-selector)
Sep 25 15:37:16 server crond[211533]: (CRON) INFO (running with inotify support)
Sep 25 15:37:16 server crond[211533]: (CRON) INFO (@reboot jobs will be run at computer's startup.)
Sep 25 15:38:24 server crontab.relink.1440704789[211624]: (domain) LIST (domain)
Sep 25 15:38:24 server crontab.relink.1440704789[211625]: (domain) REPLACE (domain)
Sep 25 15:38:44 server crontab.relink.1440704789[211638]: (domain) LIST (domain)
Sep 25 15:38:44 server crontab.relink.1440704789[211639]: (domain) REPLACE (domain)
Sep 25 15:39:01 server crond[211533]: (domain) RELOAD (/var/spool/cron/domain)
I tried restarting crond also but that didn't help. Anyone know what might be the problem?
-
Are you creating the cronjob in cPanel or SSH? 0 -
I created them in cPanel. 0 -
Strange, in SSH using: # crontab -u USER -l show the job you have setup in cPanel? 0 -
Yes it does: root@server [~]# crontab -u domain -l 0 23 * * * lsphp /home/domain/domains/domain.se/cli/akeeba-backup.php > /dev/null 2>&1 20 15 * * * lsphp /home/domain/domains/domain.se/cli/akeeba-update.php > /dev/null 2>&1 0 1 * * * lsphp /home/domain/domains/domain.se/cli/admintools-update.php > /dev/null 2>&1 0 2 * * * lsphp /home/domain/domains/domain.se/cli/admintools-dbrepair.php > /dev/null 2>&1 * * * * * php /home/domain/domains/domain.se/cli/garbagecron.php 0 4 * * * lsphp /home/domain/domains/domain.se/cli/deletefiles.php > /dev/null 2>&1 0 5 * * * lsphp /home/domain/domains/domain.se/cli/update_cron.php > /dev/null 2>&10 -
Your running CL? This is just a random shot in the dark but can you try disabling cagefs for that user. # /usr/sbin/cagefsctl --disable domain
then see if they start firing.0 -
Yes I am, I run Cloudlinux 7.1 and WHM 11.50.1 build 3. Doesn't seem to make a difference. I ran: cagefsctl --disable domain Restarted crond, save the cron job again and tailed /var/log/cron. Same thing: Sep 25 22:08:22 server crond[232455]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 82% if used.) Sep 25 22:08:22 server crond[232455]: (CRON) bad hour (/etc/cron.d/lvemanager-selector) Sep 25 22:08:22 server crond[232455]: (CRON) INFO (running with inotify support) Sep 25 22:08:22 server crond[232455]: (CRON) INFO (@reboot jobs will be run at computer's startup.) Sep 25 22:11:18 server crontab.relink.1440704789[232724]: (domain) LIST (domain) Sep 25 22:11:19 server crontab.relink.1440704789[232726]: (domain) LIST (domain) Sep 25 22:11:27 server crontab.relink.1440704789[232730]: (domain) LIST (domain) Sep 25 22:11:31 server crontab.relink.1440704789[232732]: (domain) LIST (domain) Sep 25 22:11:31 server crontab.relink.1440704789[232733]: (domain) REPLACE (domain) Sep 25 22:11:37 server crontab.relink.1440704789[232735]: (domain) LIST (domain) Sep 25 22:11:37 server crontab.relink.1440704789[232736]: (domain) REPLACE (domain) Sep 25 22:12:01 server crond[232455]: (domain) RELOAD (/var/spool/cron/domain)0 -
What does: yum list installed |grep -i cron
give you0 -
root@server [~]# yum list installed |grep -i cron cpanel-perl-514-Config-Crontab.x86_64 1.40-1.cp1146 installed cpanel-perl-514-Set-Crontab.x86_64 1.03-1.cp1146 installed cronie.x86_64 1.4.11-13.el7 @base cronie-anacron.x86_64 1.4.11-13.el7 @base crontabs.noarch 1.11-6.20121102git.el7 @anaconda 0 -
Ok so apparently it doesn't work to run the lsphp command with cron. It work fine when I run it from the CLI as the user but cron won't run it. The cron jobs works fine when I use the php command instead. But even if the cron jobs run now it doesn't show up in the cron log. 0 -
You may need to specify the full path to lsphp. /usr/local/bin/lsphp As far as it not showing up in the cron log, that is odd, unless Centos7 stores each user's cron logs in a different area possibly? I have yet to dive into Centos7 but I haven't run into the issue you are seeing on Centos6. 0 -
I looked at another CentOS 7 cPanel server and it's the same thing there, the cron log is filled with basically what I pasted in a earlier post in this thread. 0 -
Hello :) Please let us know if the following commands help address this issue: /bin/systemctl restart crond cagefsctl "force-update
Also, do you notice any error messages if you run "crontab -e" while logged in via SSH as the user? Thank you.0
Please sign in to leave a comment.
Comments
12 comments