From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1020c6,bedbbee8b27b663b X-Google-Attributes: gid1020c6,public X-Google-Thread: fee84,bedbbee8b27b663b X-Google-Attributes: gidfee84,public From: Jeff Denham Subject: Re: killing a process by name? Date: 1999/06/09 Message-ID: <375E6296.57AAAE0C@allaire.com>#1/1 X-Deja-AN: 487474762 Content-Transfer-Encoding: 7bit References: <375d6a41.14695581@news.aurora.edu> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@digex.net X-Trace: dca1-nnrp1.news.digex.net 928932621 207.86.119.34 (Wed, 09 Jun 1999 08:50:21 EDT) Organization: Allaire Corporation MIME-Version: 1.0 NNTP-Posting-Date: Wed, 09 Jun 1999 08:50:21 EDT Newsgroups: comp.unix.osf.osf1,comp.unix.admin Christopher Kolar wrote: > Hello everyone. This is probably a basic question, but I have not > found the solution yet so I thought I would float it. I have a host > running OSF 4.0d. After everyone leaves for the day I am going to > have cron start a program "foo". Foo should run until midnight, when > it needs to be killed so that out nightly backups can happen. > > Problem is that: a) foo has no -kill or similar tag; b) foo does not > drop the process number into a pid file that can be piped into a kill > command. > > So my question, is ther a simple way to set up a shell script that > cron can call at midnight that will grep "foo" out of the ps command, > and then kill -PID for foo? I am not much of a shell script > programmer, and only play a system administrator on TV, so those are > two strikes against me. Any help or pointers to the right resources > would be much appreciated. Well, it's really too bad that this Compaq Unix thing doesn't have a decent proc tools offering, like Solaris 7 does. There you can just use the pkill command to select processes by name using regular expression matching and send them the signal of your choice. Shame on you Compaq! __________________________________________________ Jeff Denham (jdenham@allaire.com) Allaire Corp: Resource-management software for building and managing fast, reliable web sites See us at http://www.allaire.com and http://www.brighttiger.com 125 Nagog Park Acton, MA 01720 Phone: (978) 263-5455 x177 Fax: (978) 263-5547 ;^)