in reply to Kill a script at a certain time

I'd write a crontoling controling script to start stop and monitor the script.

#/bin/sh MY_BIN=/path/to/my/prog MY_PID=/var/run/my.pid if [ ! -x $MY_BIN ] ; then echo -n "My Program not installed ! " exit 5 fi case "$1" in start) echo -n "Starting my program " /sbin/checkproc -p $MY_PID $MY_BIN if [ $? -eq 0 ] ; then echo -n "- Warning: my program already running ! " else [ -e $MY_PID ] && echo -n "- Warning: $MY_PID exists ! " fi /sbin/startproc -p $MY_PID $MY_BIN ;; stop) echo -n "Shutting down my program " /sbin/checkproc -p $MY_PID $MY_BIN [ $? -ne 0 ] && echo -n "- Warning: my program not running ! " /sbin/killproc -p $MY_PID -TERM $MY_BIN ;; status) /sbin/checkproc -p $MY_PID $MY_BIN [ $? - ne 0 ] && echo "my program not running! help" ;; *) echo "usage" exit 1; ;; esac exit 0;

Just have a look at one not so big /etc/init.d file (or /etc/rc.d or whatever your unix has) and adapt it to your needs, this one should work on any fairly recent linux-box (taken and adapted from a SuSE box (I'm at work, don't blame me ;))

With something like this, you can easily control the script from cron.
You have to change it so that it to only echos things if something went wrong, cause cron will spam you mad if you don't. If you are not alone interested in the results, consider a mail-wrapper

regards,
tomte


Edit:added missing ;; in default case