Add a method (that includes your 2 second sleep) to your model, then
run it like this:
script/runner -e production "Model.method" &
--
Greg Donald
http://destiney.com/
You can make it into a shell script and then put that into a cron job.
The shell script will produce a pid you can use to check for to
start/stop appropriately:
#!/bin/sh
script="foo.sh"
pidfile="foo.pid"
if test -r $pidfile
then
scriptpid=`cat $pidfile`
if `kill -CHLD $scriptpid >/dev/null 2>&1`
then
exit 0
fi
echo ""
echo "Stale $pidfile file, erasing..."
rm -f $pidfile
fi
echo ""
echo "Couldn't find script '$script' running, running now."
echo ""
./$script
exit 0