RE: drive space shell script help ?

From: Brent Bailey (mrb_at_bmyster.com)
Date: 09/15/03

  • Next message: David F. Severski: "Make Release with CVSROOT pointing at a CVSup mirror"
    Date: Mon, 15 Sep 2003 16:45:25 -0400 (EDT)
    To: "Charles Howse" <chowse@charter.net>
    
    

    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"
    >
    _______________________________________________
    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"
    

  • Next message: David F. Severski: "Make Release with CVSROOT pointing at a CVSup mirror"

    Relevant Pages

    • Re: Outsiders observation upon the pros and cons of Debian
      ... approach to getting your way to a worldwide audience. ... and seen acrimonious responses from camps ... I fail to see how someone who makes no demands is ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
      (Debian-User)
    • 4GB HD only reporting half capacity (2GB)
      ... In the BIOS, fdisk, etc., all are now reporting a capacity of 2.1 GB. ... report the correct information. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: eth* devices (again)
      ... If eth0 is taken by something, you cannot assign it again by such rules, so all of them will fail. ... But the wireless card broke badly at that point. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx with a subject of "unsubscribe". ...
      (Debian-User)
    • Migrate from K7 to AMD64-K8
      ... I have searched Google and the archive, but not found what I am looking ... I understand all that stuff about install and chroot a 32/64 bit partition. ... But I fail to find hints on a clean migration path for my Sarge 32-bit ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)
    • Re: check superblock
      ... backwards through scripts to see where md2 might fail. ... I've noticed the last week or two that you've done a tremendous job at ... snippet of the original post to provide some background to your answers. ... To UNSUBSCRIBE, email to debian-user-REQUEST@xxxxxxxxxxxxxxxx ...
      (Debian-User)