It is currently Tue, 17 May 2022 19:44:33 GMT

Author Message
 killall or kill from script via cron
We have a custom ftp interface that runs on a Digital Unix machine that
connects to another machine (in this case Linux, but it's been others),
appends to a file then disconnects.  However, it rarely disconnects cleanly,
and every 2 days or so the ftp process gets spawned multiple times on the DU
machine.  This slows the interface considerably, and we have to go in + kill
all the related processes + restart the interface. I'd like to run a script
from cron that looks for multiple instances of this program and if there is
more than 1 kill them all, then restart it.  One instance of the program
should almost always be running, but as soon as a second get's spawned, it
means there's a problem. So, the script should do something like the
following... Look for dgxftp (the name of the program). If there are none or
only 1 instance of it, exit. If there are 2+ instances of dgxftp kill them
all then run the app's start script. Email root that a kill was needed. Any
suggestions or pointers are most appreciated. TIA.

Sent via

 Tue, 03 Jun 2003 04:50:53 GMT   
 killall or kill from script via cron

I assume you are willing and able to write your own
script. (If not, what are you doing in this newsgroup?)
Check the man pages for "ps" (list processes) "grep"
(select the ones you want), "wc" (count them), "test"
(decide whether you want ot do something"), "kill" (kill
a process), "mail" (send a message), and any other that
springs to mind. Because you pretty much described what
you want, so you should be able to write it.

 Tue, 03 Jun 2003 05:10:00 GMT   
   [ 2 post ] 

Similar Threads

1. kill/killall

2. killall ppd kills X

3. killall -CONT & killall -STOP

4. Script run via cron yields unexpected results.

5. running a script via cron, zombies

6. Testing httpd via scripts/cron

7. cron - shell script would not generate output in cron

8. Cron Problems - Script runs from shell but not cron

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software