Posted on 01-04-2013 10:12 AM
Greetings all;
I am looking/needing a report to go against the JSS that will report back the users on mac's and the size of their home directories. If anyone has created one and is willing to share it would help from reinventing the wheel.
Posted on 01-04-2013 10:56 AM
Would like this too.
Posted on 01-04-2013 01:45 PM
#!/bin/bash
cd /users/
alias=`ls | grep [0-9a-z][0-9a-z][0-9a-z] | grep -v "_spotlight" | grep -v "root" | grep -v "_" | grep -v "shared" | grep -v "Shared" | grep -v ".localized"`
cd /users/"$alias"/
hdsize=`du -h -s /users/"$alias"/ | awk {'print $1'}`
echo "$hdsize"
exit 0
this is an old script I wrote when I first started scripting so it probably could be better, but this will echo out the home directory size. you can return the variable in an extension attribute, then create a search that displays the result of the extension attribute and that should hopefully do the trick
Posted on 01-04-2013 02:00 PM
In another thread started by donmontalvo, there is a discussion about creating an Extension Attribute for Outlook 2011 identities folder size. I bet that you can use that information to help you with your request.
Posted on 01-04-2013 02:02 PM
This may need cleaned up, but it's based off of Don's script.
#!/bin/bash
echo "<result>"
UserList=`dscl . list /Users UniqueID | awk '$2 > 501 { print $1 }'`
for u in $UserList ;
do
if [ -d /Users/$u/ ]; then
results=`du -sh /Users/$u/ | grep -v "[Back" | grep -v ".plist" | awk '{print $1}'`
else continue
fi
echo $u $results
done
echo "</result>"
exit 0
Posted on 01-04-2013 02:46 PM
Thanks for posting that script Jason. It looks like we are just missing a in the du -sh command.
du -sh /Users/$u/ | grep -v "[Back" | grep -v ".plist" | awk '{print $1}'`
Other than that your script worked great.
Thanks,
Joel
Posted on 01-04-2013 05:10 PM
@Joel.Peasley I just went back and added a second slash to the line since it looks like some slashes aren't showing up when posted the way they show up in the Edit window (to precede a left bracket with a backslash, need to add a second backslash). :(
So there's two issues with the Edit window...(1) all quoted text getting BOLDED, and (2) backslash needing to be escaped with a backslash.
This line should be bolded This line should not be bolded
XL t-shirt please. :b
Don
Posted on 01-04-2013 09:48 PM
There's already a FR from rmanly on that issue:
https://jamfnation.jamfsoftware.com/featureRequest.html?id=799
Posted on 01-05-2013 12:14 AM
@mm2270 There goes my XL t-shirt. :.(
<tongue in cheek>
Posted on 01-07-2013 06:39 AM
Thank You for the responses will try this out.