Forum Moderators: bakedjake

Message Too Old, No Replies

Cron a watch job

         

turbohost

10:45 pm on Jan 5, 2006 (gmt 0)

10+ Year Member



Hi guys,

I want to cron this command 'watch lynx --dump [url.com...] > /dev/null'. If I cron it like this, the php file isn't refreshed every 2 seconds. How can I make this work?

Turbo

MattyMoose

6:54 am on Jan 8, 2006 (gmt 0)

10+ Year Member



2 seconds is too finite a time.

The most that cron will handle is a 60-second cycle, otherwise your script would fall all over itself.

Your best bet is to run a single script, something like this:


#!/bin/sh

while( [ 1 -eq 1 ] );
do
watch lynx --dump http://www.url.com/file.php > /dev/null
sleep 2;
done

Run that, and it will keep going forever. On top of that, you could have a cron (that runs every minute), that checks to see if the script is running.