iOS Backup Location on OSX

Summers
New Contributor

Greetings all. Wondering if anyone would have any insight as to ways to remotely monitor, via the JSS, the OS X iOS Backup Location, typically found here -> /Library/Application Support/MobileSync/Backup.
We have quite a few laptops whose hard drives are over 80% full, some are actually at 100%. I suspect it's people backing up their iPhones/iPads and it's chewing up space. I'd like to be able to monitor this but not sure exactly how. One note: we don't use our JSS for iOS MDM, unfortunately. Wish we did, so it may be unavailable to do right off the top.

Anyone know of a way to do this?
Thanks.

1 REPLY 1

bpavlov
Honored Contributor

I suppose you could create an extension attribute that does something like

#!/bin/bash

if [ -d "/Users/$3/Library/Application Support/MobileSync/Backup" ]; then
result=$(du -hs "/Users/$3/Library/Application Support/MobileSync/Backup" | awk '{print $1}')
echo "<result>$result</result>"
else
result="Does not exist"
echo "<result>$result</result>"
fi

I haven't tested it. But give it a try. Just note that it will only calculate the result for one user ($3 as per JSS variable) which is the user who is currently logged in. So if you have multiple users then you may need to change things up a bit by perhaps doing a for loop and adding up the results using perhaps the binary /usr/bin/bc. Good luck.