The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

User cron jobs doesn't run

Discussion in 'General Discussion' started by Erik Ellsinger, Sep 25, 2015.

  1. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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?
     
  2. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Are you creating the cronjob in cPanel or SSH?
     
  3. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    I created them in cPanel.
     
  4. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    Strange, in SSH using:

    # crontab -u USER -l

    show the job you have setup in cPanel?
     
  5. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    Yes it does:
    Code:
    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>&1
    
     
    #5 Erik Ellsinger, Sep 25, 2015
    Last edited by a moderator: Sep 25, 2015
  6. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    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.
     
  7. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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)
    
    
     
    #7 Erik Ellsinger, Sep 25, 2015
    Last edited by a moderator: Sep 25, 2015
  8. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    New Jersey
    cPanel Access Level:
    DataCenter Provider
    What does:
    Code:
    yum list installed |grep -i cron
    give you
     
  9. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    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
     
  10. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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.
     
  11. Jcats

    Jcats Well-Known Member

    Joined:
    May 25, 2011
    Messages:
    275
    Likes Received:
    31
    Trophy Points:
    28
    Location:
    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.
     
  12. Erik Ellsinger

    Erik Ellsinger Active Member

    Joined:
    Sep 25, 2015
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Sweden
    cPanel Access Level:
    Root Administrator
    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.
     
  13. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    670
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page