WEB Cron jobs with PHP

Discussion in 'OT Technology' started by int3rnal, Aug 26, 2008.

  1. int3rnal

    int3rnal Active Member

    Joined:
    Jun 15, 2001
    Messages:
    2,215
    Likes Received:
    0
    I'm trying to make a notifier script in php that will scrape a webpage and send an email notification when the search conditions are met. It would have to be completely automated and run in the background at specified intervals.

    The only way I can think of doing this is setting up a cron job, and having it run, say every 15 min. Is this the best approach? Would this be too taxing on the server?
     
  2. drpepper

    drpepper Active Member

    Joined:
    Nov 13, 2006
    Messages:
    38,076
    Likes Received:
    2
    Location:
    San Antonio
    yes. and no.
     
  3. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    i don't know how else you'd do it. if it's running every 15 minutes and just scraping one page that would hardly tax your server at all.
     
  4. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    cron > *



    I use cron to control tons of php scripts.
     
  5. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF
    if you want something automated with php, then you have to use cron jobs.
     
  6. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    or you can do a loop with wait 86400 :rofl:
     
  7. Drowned

    Drowned NameThatPornstar.com

    Joined:
    Mar 26, 2001
    Messages:
    8,534
    Likes Received:
    2
    :werd:
     
  8. intrktevo

    intrktevo New Member

    Joined:
    Oct 18, 2004
    Messages:
    5,781
    Likes Received:
    0
    Location:
    UCF
    wouldn't you have to leave the browser open though?
     
  9. crazybenf

    crazybenf Active Member

    Joined:
    Nov 14, 2001
    Messages:
    15,575
    Likes Received:
    2
    nah, open a terminal and screen it.. then run php -q cronscripthere.php

    detach terminal & let it run in the bg...
     
  10. int3rnal

    int3rnal Active Member

    Joined:
    Jun 15, 2001
    Messages:
    2,215
    Likes Received:
    0
    Thanks guys, I just wanted to make sure that I was going about it in the correct way, i'm still fairly new to php.
     

Share This Page