cronjob help needed

Discussion in 'Programming' started by sunnyverma1984, Jan 8, 2008.

  1. #1
    i have a php script and want to run it in every 15 sec. using cronjob
    can anyone help me
     
    sunnyverma1984, Jan 8, 2008 IP
  2. nasty.web

    nasty.web Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It's impossible, smallest time unit cronjob operates is a minute.
     
    nasty.web, Jan 8, 2008 IP
  3. sunnyverma1984

    sunnyverma1984 Well-Known Member

    Messages:
    342
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    120
    #3
    thanx for your reply. Any other way to run script in every 15 sec.
     
    sunnyverma1984, Jan 8, 2008 IP
  4. domainseller_1

    domainseller_1 Banned

    Messages:
    498
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    as he said its impossible!
    smallest unit is 1 minute
     
    domainseller_1, Jan 8, 2008 IP
  5. chrissyj

    chrissyj Peon

    Messages:
    56
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Simple, simple! If you are running on Linux, you can create the following script:

    #!/bin/sh
    for $count in 1 2 3 4
    do [code to run PHP script]
    sleep 15
    done


    Then, just run that script every minute via cron. Of course, there is a MUCH better way to do this, and the above code assumes that the script will compete in less than 15 secs. But, it does what you asked for!

    PM me if you need more help!
     
    chrissyj, Jan 8, 2008 IP
  6. NoobieDoobieDo

    NoobieDoobieDo Peon

    Messages:
    1,456
    Likes Received:
    53
    Best Answers:
    0
    Trophy Points:
    0
    #6
    15 sec is a really small amount of time for a loop. What is it you're doing ?
     
    NoobieDoobieDo, Jan 8, 2008 IP