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


In reply to Re: Kill a script at a certain time by Tomte
in thread Kill a script at a certain time by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.