From owner-freebsd-questions@FreeBSD.ORG Wed Apr 21 08:36:37 2010 Return-Path: Delivered-To: questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4B2F1065679 for ; Wed, 21 Apr 2010 08:36:37 +0000 (UTC) (envelope-from mcoyles@horbury.wakefield.sch.uk) Received: from smtp2.yhgfl.net (smtp3.yhgfl.net [89.207.208.210]) by mx1.freebsd.org (Postfix) with ESMTP id 8E5AE8FC29 for ; Wed, 21 Apr 2010 08:36:37 +0000 (UTC) Received: from smtp2.yhgfl.net (localhost.localdomain [127.0.0.1]) by localhost (Email Security Appliance) with SMTP id A12631BC094C_BCEB82AB for ; Wed, 21 Apr 2010 08:32:42 +0000 (GMT) Received: from smtp1-wak.yhgfl.net (smtp3-wak-ext.yhgfl.net [89.207.208.42]) by smtp2.yhgfl.net (Sophos Email Appliance) with ESMTP id 5A2331BC0933_BCEB82AF for ; Wed, 21 Apr 2010 08:32:42 +0000 (GMT) Received: from horbury.wakefield.sch.uk ([10.126.96.3]) by smtp1-wak.yhgfl.net (8.13.8/8.13.8/Debian-3) with ESMTP id o3L8aSb9005870 for ; Wed, 21 Apr 2010 09:36:30 +0100 Received: from ITTEAM02 [172.16.96.253] by horbury.wakefield.sch.uk with ESMTP (SMTPD32-7.07) id A907362000DA; Wed, 21 Apr 2010 09:36:23 +0100 From: "mcoyles" To: References: <002c01cae05e$7eab3ea0$7c01bbe0$@wakefield.sch.uk> <20100420183859.C52D9BE09@bsd118.wpafb.af.mil> <86r5m9yk0q.fsf@red.stonehenge.com> In-Reply-To: <86r5m9yk0q.fsf@red.stonehenge.com> Date: Wed, 21 Apr 2010 09:36:24 +0100 Message-ID: <003e01cae12d$b9f2b770$2dd82650$@wakefield.sch.uk> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Acrgw+810vOW2zMfQ2mm/OEvqeLFYQAaa1lA Content-Language: en-gb X-YHGfL-MailScanner-Information: Please contact the YHGfL Foundation for more information X-YHGfL-MailScanner: Found to be clean X-YHGfL-MailScanner-MCPCheck: MCP-Clean, MCP-Checker (score=0, required 0.5) X-YHGfL-MailScanner-SpamCheck: not spam, SpamAssassin (not cached, score=-4.399, required 5, autolearn=not spam, ALL_TRUSTED -1.80, BAYES_00 -2.60) X-MailScanner-From: mcoyles@horbury.wakefield.sch.uk Cc: Subject: RE: Kill via Cron... X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: mcoyles@horbury.wakefield.sch.uk List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2010 08:36:37 -0000 >>> kill -9 `ps ax | grep backup | grep -v grep | awk '{print $1}'` >>And you don't have to remember grep -v grep if you remember to use "ps >>axc" (note the c), since arguments won't show up so the arguments to >>grep won't generate a false positive. I'm actually trying to kill the following in one swep if they've taken more than 8 hours to complete... : 39028 ?? Is 0:00.01 /bin/sh -c sh /root/tools/backup/fullbackup.sh 39070 ?? I 0:00.04 /usr/bin/perl /root/tools/backup/backuptodisk.pl (perl5.8.9) 62219 ?? I 0:00.00 sh -c /sbin/dump -0 -auf - /usr | gzip -q > /backup/wednesday/usr.dump.gz 62220 ?? I 0:00.33 /sbin/dump -0 -auf - /usr (dump) 62221 ?? S 0:27.11 gzip -q 62222 ?? S 0:03.07 dump: /dev/da0s1e: pass 4: 3.82% done, finished in 1:09 at Wed Apr 21 09:48:59 2010 (dump) 62223 ?? DL 0:01.80 /sbin/dump -0 -auf - /usr (dump) 62224 ?? DL 0:01.79 /sbin/dump -0 -auf - /usr (dump) 62225 ?? DL 0:01.81 /sbin/dump -0 -auf - /usr (dump) Have tried everything suggested thus far but nothing's done it as effectively as the original command run at commandline... just trying to automate the process by having cron kill at 8am. Cheers! Marci