*BSD News Article 95118


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!news.ecn.uoknor.edu!feed1.news.erols.com!cpk-news-hub1.bbnplanet.com!su-news-hub1.bbnplanet.com!news.bbnplanet.com!news1.best.com!nntp1.ba.best.com!shell3.ba.best.com!tporczyk
From: tporczyk@shell3.ba.best.com (Tony Porczyk)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: Help a UNIX Girl :)
Date: 9 May 1997 11:40:55 -0700
Lines: 27
Message-ID: <tporczyk.863202987@shell3.ba.best.com>
References: <5kuqjf$8ia$1@news.NetVision.net.il> <5kvdnt$bai$2@news.uni-c.dk>
NNTP-Posting-Host: shell3.ba.best.com
X-Newsreader: NN version 6.5.0 #4 (NOV)
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.bsdi.misc:6842

unimgj@guldager.uni-c.dk (Morten Guldager Jensen) writes:

>Caroline Parker (wlidir@netvision.net.il) wrote:
>: 07 1 * * * find usr/mail/ -type f -size +102400c -print | mail -s 'OVER 100k Files' caroline@mydomain.com
>: PLEASE! help me to modify this line to let me check the users directories...

>Make a script containing the folowing, and call it from cron:
>  #!/bin/csh -f
>  foreach d (/usr/home/*)
>    set s = `du -s $d`
>    set s = $s[1]
>    if ($s > 100000) then
>      mail -s "OVER $s K Files in $d" caroline@mydomain.com
>    endif
>  end

This will generate one email per each directory over limit.  How about
something simpler, like this:

07 1 * * * du -sk /home/* | egrep '^[3-9][0-9][0-9][0-9]|^[1-9][1-9][1-9][1-9][1-9]+' | mail -s 'homes 3 MB and over' caroline@mydomain.com

t.
---------------------------------------------------------------------
Tony Porczyk    *   tporczyk@infobound.com   *   San Jose, California
GIT/ED d++(!d) s++:++ a? C++++ USB++++$ P+ E- W(--) N++ !k w--- M- V?
PS+++ PE++ Y+ PGP-- t+@ 5++ X-- R* b- D---- e* V-- h* r+++(*)+++(*)>?
---------------------------------------------------------------------