Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quick unix question...



Thanks.
Well, I'm looking to try something that
1) finds all volumes with du at 90% or more;
2) reports on the user usage for those volumes;
3) mails an admin with the results when needed

Since they are dragging their feet on quotes here, I thought it would be a good thing to try and learn a little more. My way probably isn't the best, but its a good learning vehicle for the moment-- I was proud I got this far!

The questions out there until the basic thing works are commented:
1) how to make human-readable [-h] and sort correctly? (my initial question here)
2) how to get the name of the volume found to be at 90% capacity from the df command to the du command. Maybe I need to output to a temp file, use a variable, or it requires something a bit more involved. If so, I'd be happy to just be directed to the proper topics/techniques so I know what to look for when searching for help.


As far as I got with the whole thing is below:

#log in to remote
ssh 198.174.6.2

#find volumes at 90+% capacity | sort numerically, ignoring 1st 4 fields
sudo df -H -l | egrep 1?9[0-9]% | sort -r +4n

#check usage on 90+% volumes
#VARIABLE for volume name?
#how to make human-readable [-h] and sort correctly?
sudo du -c -h -d 1 /Volumes/MA | sort -r -n

#mail to admin
| mail -s "Disk Usage Report" email@hidden

==
Thanks again,
brian

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Client-management mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/client-management/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.