[TriLUG] Starting and stopping jobs with cron

Greg Cox glcox at pobox.com
Thu Dec 9 21:57:22 EST 2004


> Someone suggested using $$ for the PID, but I believe that is only within
> the scope of that process (i.e. within the script itself), and possibly not
> useful in this instance since you want to kill a process from another
> process.

If you wrapper the desired program, you could do:
echo $$ > /var/local/myprog.pid
exec /path/to/myprog args

Then later,
kill `head -1 /var/local/myprog.pid`

With error checks, but.




More information about the TriLUG mailing list