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: "Adam Price" Subject: Re: killing a process by name? Date: 1999/06/09 Message-ID: <928943775.8997.0.nnrp-08.c2deb51d@news.demon.co.uk>#1/1 X-Deja-AN: 487539738 X-NNTP-Posting-Host: pappnase.demon.co.uk:194.222.181.29 References: <375d6a41.14695581@news.aurora.edu> X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 X-Complaints-To: abuse@demon.net X-Trace: news.demon.co.uk 928943775 nnrp-08:8997 NO-IDENT pappnase.demon.co.uk:194.222.181.29 Newsgroups: comp.unix.osf.osf1,comp.unix.admin Christopher Kolar wrote in message <375d6a41.14695581@news.aurora.edu>... >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. > Others will tell you about ps and grep, but an alternative is to use a shell script to start the job and record it's PID in a file. This pid can be used to kill your job. Hope this helps Adam