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.

cronjob not working as expected

Discussion in 'General Discussion' started by alexthemaster, Nov 16, 2016.

Tags:
  1. alexthemaster

    alexthemaster Member

    Joined:
    Nov 16, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    roma
    cPanel Access Level:
    Root Administrator
    Hi
    i have insert to the my user account cpanel the cron

    /usr/bin/lynx "https://domain.tld/file.php"

    and exist to

    nano /var/spool/cron/beetech

    and to
    /var/log/cron i look this

    Nov 16 18:00:01 cloud CROND[9266]: (beetech) CMD (/usr/bin/lynx "https://domain.tld/file.php")


    but the command don't working. If i past the link in my browser ise perfect but to cron i have a problem.

    i need help please. i have access to admin shell

    Tnks Alessandro
     
    #1 alexthemaster, Nov 16, 2016
    Last edited by a moderator: Nov 16, 2016
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Is this PHP hosted locally or remotely? If it's hosted locally, try using the "php" command instead. EX:

    Code:
    php /home/$username/public_html/file.php
    Thank you.
     
  3. alexthemaster

    alexthemaster Member

    Joined:
    Nov 16, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    roma
    cPanel Access Level:
    Root Administrator
    hi
    is localhost but the script work only whit remote command. in my old server whit Webmin working in new server on cpanel no.

    tnks
     
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Cron jobs created within cPanel can only access binaries available within the Jailed Shell mounts. To enable lynx or additional custom binaries for a user, you must create a custom Jailed Shell mount. The steps for this are documented at:

    How to Create Custom Jailed Shell Mounts - cPanel Knowledge Base - cPanel Documentation

    However, I suggest using an alternative such as "curl" instead. EX:

    Code:
    curl -s https://domain.tld/file.php"
    Thank you.
     
  5. alexthemaster

    alexthemaster Member

    Joined:
    Nov 16, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    roma
    cPanel Access Level:
    Root Administrator
    ok perfect. what is the contenute standard file crontab root?

    tnks
     
  6. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    The root crontab is stored at:

    /var/spool/cron/root

    Thank you.
     
  7. alexthemaster

    alexthemaster Member

    Joined:
    Nov 16, 2016
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    roma
    cPanel Access Level:
    Root Administrator
    ok but i have chenge this file . what is the standard file?
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

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

    Could you elaborate on your last question? For instance, what do you mean by standard file?

    Thank you.
     
Loading...

Share This Page