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!

Execute php file via Cron Job with Correct Rights

Discussion in 'General Discussion' started by psnabe, Dec 26, 2017.

Tags:
  1. psnabe

    psnabe Registered

    Joined:
    Jan 15, 2007
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    151
    Hi

    I need to execute the PHP script located here:
    github.com/ClouDNS/cloudns-api-bulk-updates/blob/master/cpanel-slave-zones-add/cpanel-slave-zones-add.php via Cron Jobs.

    But there do I place the php file - so it works? The script needs to be able to read:/var/named/ and write to /tmp/cloudns_invalid-zone-names.txt
     
    #1 psnabe, Dec 26, 2017
    Last edited by a moderator: Dec 26, 2017
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,962
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You could add the PHP script to the root directory (e.g. /root/custom-directory/script.php) and then add the cron job using the "crontab -e" command while logged in via SSH as root.

    Keep in mind that's a third-party script, and thus any issues that arise from it's use are unsupported.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice