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!

Start and stop cron job manually on shared host

Discussion in 'General Discussion' started by Bob Slotpole, Apr 12, 2017.

Tags:
  1. Bob Slotpole

    Bob Slotpole Registered

    Joined:
    Apr 12, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Boston
    cPanel Access Level:
    Website Owner
    I'm on a shared hosting plan at Bluehost and set up cron jobs through the cpanel cron job tab. I'm able to specify the periodicity and issue a command to trigger the php script. Is there a way from PHP to issue a cron job and set the periodicity and also from PHP to remove the cron job? Could someone provide a simple example? Thanks
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

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

    You could utilize the following cPanel API 2 function:

    cPanel API 2 Functions - Cron::add_line - Software Development Kit - cPanel Documentation

    You may also find the PHP client class helpful when using cPanel API functions with PHP scripts:

    GitHub - CpanelInc/xmlapi-php: A PHP Class for Interacting with cPanel's XML-API

    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