How to run a web page less then 1 minute with cron job?

  • jojoboy1979
  • Born
  • Born
  • jojoboy1979
  • Posts: 1

Post 3+ Months Ago

Hello all,

I want to run a php page every 30 seconds with cron job, how can I do it?
The example below is find, or it make a problem with the memory if I run it every 1 minute with cronjob?
<?
sleep(30);
Command1;
?>
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Xel02
  • Proficient
  • Proficient
  • Xel02
  • Posts: 261

Post 3+ Months Ago

What is the purpose of this PHP page? If your using Linux (which I'm guessing you are since your running cron) wouldn't a simpy shell script work better?
  • xtc
  • Novice
  • Novice
  • xtc
  • Posts: 34
  • Loc: London UK

Post 3+ Months Ago

Use atd rather than crontab. Crontab is designed for things 1minute plus. atd is deisgned for sub one minute jobs.

Also you can write a simple loop script in bash that can call on the php script for ever in the background.
  • mrdance
  • Born
  • Born
  • mrdance
  • Posts: 2

Post 3+ Months Ago

If you are using Windows and want a more advanced scheduler with second precision and remote php-execution you should look at VisualCron -> http://www.visualcron.com

regards,

md

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 62 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.