SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Oct 2002
    Location
    mtl.
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question PHP script and cron job

    I have a script that needs to run automaticaly every x minutes and i am supposed to setup a cron job.

    The script is php_cron.php for example and is places outside the Web root.

    How do i setup the cron job?
    Attached Images Attached Images
    Last edited by Arsenik; Mar 30, 2003 at 11:15.

  2. #2
    SitePoint Member
    Join Date
    Oct 2002
    Location
    mtl.
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Arsenik
    I have a script that needs to run automaticaly every x minutes and i am supposed to setup a cron job.

    The script is php_cron.php for example and is places outside the Web root.

    How do i setup the cron job?
    Why isnt the attachement shown??? here the image...


  3. #3
    Now with customized title Jump's Avatar
    Join Date
    Sep 2002
    Location
    The Restaurant at The End of The Universe
    Posts
    1,423
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is an example of what I use.

    */5 means it runs every five minutes.

    **** means every hour every day every month every weekday

    /usr/bin/php is the path to php followd by the file directory from root.

    /dev/null 2>&1 tells it not to send me a email everyfive minutes. (you might want to add this after you know the cron works so you get the errors that are returned.

    hope this helps.

    */5 * * * * /usr/bin/php /home/user/public_html/directory/cronphp.php > /dev/null 2>&1

  4. #4
    SitePoint Member
    Join Date
    Oct 2002
    Location
    mtl.
    Posts
    17
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Jump
    Here is an example of what I use.

    */5 means it runs every five minutes.

    **** means every hour every day every month every weekday

    /usr/bin/php is the path to php followd by the file directory from root.

    /dev/null 2>&1 tells it not to send me a email everyfive minutes. [img]images/smilies/rolleyes.gif[/img] (you might want to add this after you know the cron works so you get the errors that are returned.

    hope this helps.

    */5 * * * * /usr/bin/php /home/user/public_html/directory/cronphp.php > /dev/null 2>&1
    Thanks for your help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •