Recurring OS X "cleaning" / automating "Onyx"

New Contributor


We have a BU that has about 20 Mac's. From time to time, when we need to solve strange issues that are not configuration issues, I often run "Onyx", and unless there is an underlying HW issue, it solves the problem. I usually run the Automation, and have it rebuild just about all the caches.

I tried browsing through the scripts here, which all look very interesting (I'm a newbie here :-) but I couldn't find anything.

Is there a best practice for preventing these cache issues from time to time, or a way to automate purging them to prevent issues in the first place? The BU manager would like to not have to open a support ticket with us, if this can be prevented by routine maintenance.

Many thanks,


Valued Contributor

Policies can do that.

Maintenance payload...


New Contributor

Hi Bruce,

To my knowledge you can clear some of the caches simply by creating a policy to perform maintenance on any mac in your JSS quite easily. There are some very useful features. If you create a new computer policy under Option->Maintenance select configure you can enable the following:

Fix Disk Permissions Fix ByHost Files Flush System Caches
Flush caches from /Library/Caches/ and /System/Library/Caches/, except for any caches Flush User Caches
Flush caches from ~/Library/Caches/, ~/.jpi_cache/, and ~/Library/Preferences/Microsoft/Office version #/Office Font Cache Verify Startup Disk

Generally this will get the majority of what OnyX gets when it flushes your cache in automatic mode. You can also have this maintenance tool verify the startup disk and disk permissions on the machine. At my office we have it scoped to Desktop Admins and Users. It shows up in self-service as Repair Utility, but you can customize the name and icon in the JSS. We have it scoped to "All Computers" and used exclusions in cases where certain departments/users didn't want it. As you only have 20 systems this may be a better solution than physically going to each user's desk for a support call since they can run it and it's basically a click away after logging into self service. This tool also doesn't do everything that OnyX does which in this case is a good thing. I've had inexperienced technicians hose people's OS installs by incorrectly utilizing OnyX and I've never had that issue with the Maintenance Script from the JSS. It's easy to implement and saves us a lot of service calls due to "slow" macs.