*BSD News Article 95048


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!howland.erols.net!math.ohio-state.edu!jussieu.fr!oleane!weld.news.pipex.net!pipex!plug.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.utell.co.uk!usenet
From: brian@shift.utell.net (Brian Somers)
Newsgroups: comp.unix.bsd.386bsd.misc
Subject: Re: Help a UNIX Girl :)
Date: 9 May 1997 11:45:46 GMT
Organization: Awfulhak Ltd.
Lines: 34
Message-ID: <5kv2pa$8cq@ui-gate.utell.co.uk>
References: <5kuqi9$8g3$1@news.NetVision.net.il>
Reply-To: brian@awfulhak.org, brian@utell.co.uk
NNTP-Posting-Host: shift.utell.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.386bsd.misc:1252

In article <5kuqi9$8g3$1@news.netvision.net.il>,
	Caroline Parker <wlidir@netvision.net.il> writes:
> Hi Friends!!!
> 
> I have a little question, i have a Virtual Server in a BSDI Box, now,
> i made Directories in which people can put their WEBPAGES and graphics...
> The users can also create directories inside their root directories ok?
> 
> Now, i need to check that they DO NOT put more files over 3 Mega.
> I need to modify this line to check if their WHOLE directory and subdirectories (if they exist)
> DO NOT HAVE MORE THAN THE 3 Mega, in that case, send me an e-mail with
> the directory's name and memory amount that he is taking.
> I made something similar to check  e-mail box files size..... with the cronfile....
> 
> 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...
> Thank YOU VERY MUCH!
> I have NOT POSIBILITY in my system TO USE THE QUOTAs to do this...

I don't understand - are you searching a list of known directories
to see whether their content is recursively greater than 3Mb ?

Try

07 1 * * * BLOCKSIZE=K du -s $allmydirectories | while read size name; do test $size -gt 3072 && echo $size $name | mail -s "$size $name" caroline@mydomain.com

> Caroline :)
> 

-- 
Brian <brian@awfulhak.org> <brian@freebsd.org>
      <http://www.awfulhak.org>
Don't _EVER_ lose your sense of humour !