Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

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.

cron job not working

Discussion in 'General Discussion' started by mywish1, Jan 23, 2017.

Tags:
  1. mywish1

    mywish1 Active Member

    Joined:
    Sep 13, 2014
    Messages:
    25
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    hi
    i have set some cron jobs but its not working i i have set path like in cpanel
    /home/user/public_html/domain.com/fetch/mov.php > /dev/null 2>&1
    but its not adding anything in database i set some php path on there to get something and add them in database but still its not working commands not working i dont know why

    may be cron job is disable or what is issue i have no idea
    i m running centos 7 with cpanel whm latest version waiting thanks.
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,428
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This is not a valid command. You'd need to use something such as:

    Code:
    php /home/user/public_html/domain.com/fetch/mov.php > /dev/null 2>&1
    Thank you.
     
    ItsMattSon likes this.
  3. mywish1

    mywish1 Active Member

    Joined:
    Sep 13, 2014
    Messages:
    25
    Likes Received:
    1
    Trophy Points:
    3
    cPanel Access Level:
    Root Administrator
    is that this is not valid path
    /usr/bin/php -q /home/user/public_html/domain.com/fetch/mov.php > /dev/null 2>&1
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,428
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
  5. ItsMattSon

    ItsMattSon Well-Known Member

    Joined:
    Sep 5, 2016
    Messages:
    140
    Likes Received:
    29
    Trophy Points:
    28
    Location:
    Perth
    cPanel Access Level:
    Root Administrator
    In addition to Michael's advice, i've found that my Magento crons don't run unless I use /usr/bin/php-cli instead of /usr/bin/php but that's probably circumstantial :)

    EDIT: Disregard the above! Not sure if something changed between 58 and 62 but /usr/bin/php-cli symlink doesn't appear to exist anymore so I updated my Magento crons to /usr/local/bin/php (which use the php-cli binary as per Michael's documentation link)
     
    #5 ItsMattSon, Feb 13, 2017
    Last edited: Feb 13, 2017
Loading...

Share This Page