Setup a CRON job in cPanel
Print
  • 0

If you’d like to run a script on your website at specified intervals, you can just setup a CRON job and it will run your script automatically at that time. Here’s how you set it up:

  1. Login to your cPanel

  2. Scroll down to Advanced section

  3. Click on "CRON jobs"

  4. Set the time interval for which you’d like to run your CRON job
    Note: Cron jobs with frequency of less than 15mins will default to 15mins to prevent crons from using up precious server resources

  5. Enter the command to eun your script:
    For example, to run a PHP script at an interval, set the command as: php /home/username/public_html/cron.php (where cron.php is your PHP file)
    If you’d like to see more such examples 

     6. Click on "Add New Cron Job"

 

That's it. Just sit back and relac and the cron job will run automatically to run your script at regular intervals.

Je li Vam ovaj odgovor pomogao?

Vezani članci