From owner-freebsd-questions@FreeBSD.ORG Mon Sep 15 13:40:38 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 61CA216A4BF for ; Mon, 15 Sep 2003 13:40:38 -0700 (PDT) Received: from bmyster.com (loqtis.bmyster.com [65.162.190.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0D96543F85 for ; Mon, 15 Sep 2003 13:40:37 -0700 (PDT) (envelope-from mrb@bmyster.com) Received: from loqtis.bmyster.com (localhost.bmyster.com [127.0.0.1]) by bmyster.com (8.12.9/8.12.9) with ESMTP id h8FKjU6f041803; Mon, 15 Sep 2003 16:45:33 -0400 (EDT) Received: (from www@localhost) by loqtis.bmyster.com (8.12.9/8.12.9/Submit) id h8FKjPbj041802; Mon, 15 Sep 2003 16:45:25 -0400 (EDT) X-Authentication-Warning: loqtis.bmyster.com: www set sender to mrb@bmyster.com using -f Received: from 207.5.142.198 (SquirrelMail authenticated user mrb) by bmyster.com with HTTP; Mon, 15 Sep 2003 16:45:25 -0400 (EDT) Message-ID: <65183.207.5.142.198.1063658725.squirrel@bmyster.com> In-Reply-To: <003801c37bbf$964b67c0$04fea8c0@moe> References: <003801c37bbf$964b67c0$04fea8c0@moe> Date: Mon, 15 Sep 2003 16:45:25 -0400 (EDT) From: "Brent Bailey" To: "Charles Howse" User-Agent: SquirrelMail/1.4.0 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 X-Priority: 3 Importance: Normal cc: freebsd-questions@freebsd.org Subject: RE: drive space shell script help ? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: mrb@bmyster.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Sep 2003 20:40:38 -0000 Awesome that worked ..Im also going to try some of the other options you had mentioned..I wanted to thank you for your help :-) This has got to be the best dam mailing list there is :-) -- Brent Bailey CCNA Bmyster LLC Computer Networking and Webhosting Network Engineer, Webmaster, President http://www.bmyster.com mrb@bmyster.com 207-247-8330 > The more I play with your script, the more fun it becomes. > > #!/bin/sh > # this is a script to check drive space and email HSD dept. > # > cd ~bbailey > rm drvspc.txt # Once I'm in ~bbailey, I don't need the complete path to > any files there. > > df -k | > # You have to get rid of the word 'Capacity' or your comparison will > fail, > grep -v Capacity | > # There's no need to check the /proc filesystem, it'll always be full, > grep -v /proc | > awk '{print$5}' | > # You have to use sed to eliminate the % from df -k or the comparison > will fail. > sed -e 's/%//' > drvspc.txt > cat drvspc.txt | > while read i > do > if [ $i -gt 89 ] ; then > mail -s "check drive space on core" bbailey@whatever.com > fi > done > # Quotes not necessary when echoing a single word, but I wouldn't do > this, you > # might want to schedule this with cron and it'll clutter up your screen > # if you tell it to say 'done' every time it runs. > echo done > exit 0 > > > Thanks, > Charles > > Got a computer with idle CPU time? > Join SETI@home and help make history! > http://setiathome.ssl.berkeley.edu/ > > > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to > "freebsd-questions-unsubscribe@freebsd.org" >