Erik Ellsinger

Well-Known Member
Sep 25, 2015
58
1
8
Sweden
cPanel Access Level
Root Administrator
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:

Code:
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?
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
Strange, in SSH using:

# crontab -u USER -l

show the job you have setup in cPanel?
 

Erik Ellsinger

Well-Known Member
Sep 25, 2015
58
1
8
Sweden
cPanel Access Level
Root Administrator
Yes it does:
Code:
[email protected] [~]# 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>&1
 
Last edited by a moderator:

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
Your running CL? This is just a random shot in the dark but can you try disabling cagefs for that user.

Code:
# /usr/sbin/cagefsctl --disable domain
then see if they start firing.
 

Erik Ellsinger

Well-Known Member
Sep 25, 2015
58
1
8
Sweden
cPanel Access Level
Root Administrator
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:

Code:
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)
 
Last edited by a moderator:

Erik Ellsinger

Well-Known Member
Sep 25, 2015
58
1
8
Sweden
cPanel Access Level
Root Administrator
[email protected] [~]# 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
 

Erik Ellsinger

Well-Known Member
Sep 25, 2015
58
1
8
Sweden
cPanel Access Level
Root Administrator
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.
 

Jcats

Well-Known Member
PartnerNOC
May 25, 2011
807
160
168
New Jersey
cPanel Access Level
DataCenter Provider
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.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,258
463
Hello :)

Please let us know if the following commands help address this issue:

Code:
/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.