Backup and Purge Cache Data

Script Type: Bash

Cache data is described as any data that persists longer than temporary data. Apps normally do not require the cached data to function, but it can help to improve their performance.

Examples of cache data range from database cache files to downloaded content (including app installers). Depending on the app, the cache data may also include settings and other support files.

Generally, apps are responsible for maintaining their own cache folders but when problems are experienced on the computer, you may need to purge the cache data as a troubleshooting step.

When the app settings or support files are included in the cache (for example, browser passwords), a purge removes these items and resets the app to default. Once purged, caches are recreated as required.

As cache data is not backed up by iTunes and iCloud, the Backup and Purge Cache Data task creates a backup copy of the cache folders before purging begins. These time stamped backup folders are in the regular cache directory. For computer maintenance, the backup folders created by the app are automatically deleted after 30 days.

The Backup and Purge Cache Data task is queued until the user next logs off the computer after the scheduled execution time. The Task output contains the discovered cache and any actions.

Parameter Description
/Users/*/Library/Caches User cache
/System/Library/Caches System cache
/Library/Caches Application cache
/private/var/folders Temporary items
Hide macOS notification when script is run Enables you to run the task without notifying the user