Skip to main content

run a php file every 10 seconds

Comments

5 comments

  • RicRey
    the temporary solution I found was to put a delay in the crons, but that means that I had to create several crons and I don't think it's the best solution... I hope someone finds something better and tells me how to implement it.
    * * * * * sleep 25 && wget -q -O /dev/null Edit Delete
    * * * * * sleep 45 && wget -q -O /dev/null Edit Delete
    * * * * * sleep 15 && wget -q -O /dev/null Edit Delete
    * * * * * wget -q -O /dev/null Edit Delete
    * * * * * sleep 20 && wget -q -O /dev/null Edit Delete
    * * * * * sleep 40 && wget -q -O /dev/null
    0
  • quietFinn
    Found this kind of solution: * * * * * for i in {1..6}; do /bin/wget -q -O /dev/null
    0
  • RicRey
    Found this kind of solution: * * * * * for i in {1..6}; do /bin/wget -q -O /dev/null
    0
  • quietFinn
    for i in {1..6}; COMMAND; done means that the COMMAND will be executed 6 times. Also: Since the sleep is executed only after the command is finished, the interval may be longer than 10 seconds, depending on how long the command takes. This should be taken into account.
    0
  • RicRey
    for i in {1..6}; COMMAND; done means that the COMMAND will be executed 6 times. Also: Since the sleep is executed only after the command is finished, the interval may be longer than 10 seconds, depending on how long the command takes. This should be taken into account. & sleep 5; done
    0

Please sign in to leave a comment.