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.

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:
    2
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    42,734
    Likes Received:
    1,706
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    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.
     
Loading...

Share This Page