Hello, thank you for looking at my post. I have been working on the issue with /Private/Var/Folders growing in size. I took another members advice and am currently using this script:
#!/bin/sh
userList=`dscl . list /Users UniqueID | awk '$2 > 1000 {print $1}'`
echo "Deleting mobile accounts…"
for u in $userList ; do
dscl . delete /Users/$u
done
echo "Deleting all user cached files…"
rm -f -R /private/var/folders/*
shutdown -r now
I have created a Smart Group that records all MacBook Airs with less than 60GB of storage available and created a policy to run the above script on logout. If I leave the script "as is" it works fine. It removes what I need and reboots the machine. My only concern is under the "Logs" it states "Pending". If I remove the reboot command and execute the policy again the log shows "Completed". I'm pretty sure Recon is not running and submitting the information back to our JSS before the machine reboots. Is there an effective way for the script to wait for recon to finish and then reboot so the logs show "Completed" ?
Any advice is much appreciated. Thank you in advance.
