Closed Thread
Results 1 to 2 of 2

Thread: Cronjob

  1. #1
    codeman_nz87 is offline x10Hosting Member codeman_nz87 is an unknown quantity at this point
    Join Date
    Jun 2011
    Posts
    12

    Cronjob

    How do I set up a php script to run as a cron job?

  2. #2
    Skizzerz's Avatar
    Skizzerz is offline Contributors Skizzerz will become famous soon enough
    Join Date
    Nov 2007
    Location
    Texas
    Posts
    2,153

    Re: Cronjob

    1. Only do this if you actually understand what a cron job is and have a reason for using one
    2. You will need to configure your script to not output ANYTHING. If you need to have output, use fopen/fwrite or file_put_contents to log stuff to a file
    3. Open up the Cron Jobs icon in cPanel, select an interval at which you wish to run your script (needs to be at LEAST every 5 minutes, trying to run a cron job every minute or trying to run two cron jobs at once will result in all of them being deleted)
    4. In the command, type /usr/bin/php /home/yourcpanelusername/path/to/script.php > /dev/null &2>1
    5. Save
    Ryan Schmidt | Level 2 Support
    █ 888-X10-9668 - ryan[@]x10hosting.com
    x10Hosting - Giving Away Hosting Since 2004
    Premium Hosting | VPS Services

Closed Thread

Similar Threads

  1. Please HELP how to use cronjob
    By vhadz in forum Programming Help
    Replies: 2
    Last Post: 05-28-2010, 08:55 AM
  2. Cronjob not working
    By danrulz98 in forum Free Hosting
    Replies: 2
    Last Post: 04-23-2010, 08:52 AM
  3. Why use cronjob
    By centbux in forum Free Hosting
    Replies: 1
    Last Post: 10-20-2008, 04:47 PM
  4. cronjob won't run
    By stocks in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-11-2008, 08:04 PM
  5. Cronjob
    By yuriman in forum Free Hosting
    Replies: 3
    Last Post: 03-23-2008, 05:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers