I have been working on an extension attribute to display the size of the Outlook identity on client macs. I have taken some cues from the posting here , and although that script works for me it generates a list of all users and the directory names. I would like to simply get the size of the folder for the currently logged in user, as I am not interested in the Outlook folder sizes for our local admin or shared accounts. Here's what I have so far:
#!/bin/bash
echo "<result>"
if test -e /Users/$USER/Documents/Microsoft User Data/Office 2011 Identities ; then
du -sh /Users/$USER/Documents/Microsoft User Data/Office 2011 Identities | cut -f1
else echo "Not Found"
fi
echo "</result>"
exit 0
When i run this script locally, it returns
591M
Which is what i want. However, in the JSS, it always returns "Not Found". Any ideas on what is wrong here? It is probably something small and obvious, as I am fairly new to scripting