We have fleets of laptops that have limited space once our software is installed on it. What ever the issue that is causing the creation of theses files and –err not flushing them, we are ignoring for the moment. But I would like to automatically delete the contents /private/var/folders/. We have maybe 5-10 students log in to a laptop a day. Not sure if that will be an overkill. Any help would be appreciated.
MacOS – Login Script for deleting contents of /private/var/folders
accountsfoldersmacosscriptserver.app
Related Question
- Deleted Private/Var Folder on macOS – What to Do
- Girlfriend’s Laptop Won’t Backup to Time Machine Server – Fix
- MacOS – Exclude folder from sync from iCloud to device (laptop)
- macOS – How to Troubleshoot Reoccurring Security Access Prompts
- MacOS – Accidentally deleted private/var/folders on macOS Big Sur
Best Answer
It's a simple way. You can use the
getconf DARWIN_USER_CACHE_DIR
command to get the per-user temporary files and caches directory. and remove it. edit the '/etc/profile' file, add the following codes in it(not test yet):