WebFaction
Community site: login faq

Hello!

I am new to PHP and web development, so please leave detailed responses.

I am currently running a PHP website, and I want my server to send a request to itself every three seconds. I have looked in to Cron however, they limit it to minutes and I want to know if there is a simpler solution then Cron.

Thanks,

Lex

asked 01 Dec '13, 15:15

alexanderm006
11
accept rate: 0%

Just to be clear, by "refresh itself", I mean send a request to itself.

(01 Dec '13, 15:51) alexanderm006

You can use a cronjob that uses a for loop to run 20 times every minutes and sleeps for 3 seconds:

* * * * * for i in {1..20}; do your_command & sleep 3; done;
permanent link

answered 01 Dec '13, 16:54

timg ♦♦
1.3k4
accept rate: 30%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×262
×81
×50
×17
×9

question asked: 01 Dec '13, 15:15

question was seen: 1,902 times

last updated: 01 Dec '13, 16:54

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM