Hi everybody, thank's for the help. i've now an other problem : i want the script to tell me when a directory has a size up to 500M. i can't get it with du -hs /mnt/charlie/backup because it shows size of the directory and the name. here is the code i've done : for size in ( du -hs /mnt/charlie/backup ); do if [ $size = 500M ]; then echo Need to rip a CD fi done thank you for help Charlie Ti
Þann fimmtudagur 14 júní 2001 18:52 skrifaðir þú:
Hi everybody, thank's for the help. i've now an other problem : i want the script to tell me when a directory has a size up to 500M. i can't get it with du -hs /mnt/charlie/backup because it shows size of the directory and the name.
here is the code i've done : for size in ( du -hs /mnt/charlie/backup ); do if [ $size = 500M ]; then echo Need to rip a CD fi done
thank you for help Charlie Ti
for x in directory1/. directory2/. directory3/. do let Y="`du -ls $x | awk '{print $1/1024}' | sed 's/\..*//'`" if [ $Y -gt 499 ] then echo "Burn CD of $x" fi done That should tell you to burn all 500Mb directories and larger... -tosi
On Thu, Jun 14, 2001 at 08:52:56PM +0200, shadout@club-internet.fr wrote:
Hi everybody, thank's for the help. i've now an other problem : i want the script to tell me when a directory has a size up to 500M. i can't get it with du -hs /mnt/charlie/backup because it shows size of the directory and the name.
here is the code i've done : for size in ( du -hs /mnt/charlie/backup ); do if [ $size = 500M ]; then echo Need to rip a CD fi done
I don't know what du -h does, but if you only want to extract one part of the du report, then I guess you want to have a look at 'man awk'. e.g. to give you the first column: awk '{print $1}' -- David Smith Tel: +44 (0)1454 462380 (direct) STMicroelectronics Fax: +44 (0)1454 617910 1000 Aztec West TINA (ST only): (065) 2380 Almondsbury Home: 01454 616963 BRISTOL Mobile: 07932 642724 BS32 4SQ Work Email: Dave.Smith@st.com Home Email: David.Smith@ds-electronics.co.uk
Hi everyone. Can I find somewhere SuSE 7.0 CD-1 as ISO-image? I broke mine... I had the set in my bag and ofcourse Mr. Murphy was there too :-) J. Tamminen
participants (4)
-
Charlie Ti
-
Dave Smith
-
Jaakko Tamminen
-
Tor Sigurdsson