Maintenance scripts on Mac are part of your system’s self-optimizing design. Ever since 2016, when Apple released macOS High Sierra, we have enjoyed the self-cleaning utility known as maintenance scripts.
These scripts are responsible for clearing out temp files, network statistics, twin downloads, and Apple-related cache files. Your Mac will run significantly better when maintenance scripts have a chance to run. Luckily, macOS handles this automatically – most of the time.
However, if maintenance scripts fail to perform as expected, it can be helpful to take matters into your own hands. There are two simple ways to do this, which we’ll go over in this blog. Let’s get started!
Run Maintenance Scripts on Mac via Terminal
Your Mac is designed to run maintenance scripts automatically. Typically, these scripts are programmed to run between 3 and 5 am every day. But as you can imagine, you’ll miss out if your Mac is off during these hours. Unless you’re using your computer at the time, or just leaving it on overnight, you’ll continually miss these maintenance tasks.
The next best thing is to run maintenance scripts yourself. It is relatively easy to do this manually. All you need is this guide and about two minutes of your time. Let’s break down the steps.
Step 1: Open Terminal
First, open up Finder and go to the Applications folder.
Inside the Applications folder, find the Utilities folder and open it.
Look for an app called Terminal and launch it.

©History-Computer.com
Step 2: Enter Maintenance Script Command
Once Terminal is up and running, you’ll see a command line interface.
Type in the following command exactly: “sudo periodic daily weekly monthly” (without the quotes).
After typing the command, simply hit the Return key on your keyboard.

©History-Computer.com
Step 3: Enter Your Password
Right after typing the command, you might see a prompt asking for your password.
Type in your Admin password (don’t worry if you don’t see any characters while typing) and hit Return.
Now, just sit back and let the scripts do their thing. Wait patiently until the scripts finish running and you see the Terminal ready for your next command.
Run Maintenance Scripts via a Third-Party Application
If using the Terminal makes you a little nervous, or you aren’t comfortable typing commands, you can still run maintenance scripts. Many apps claim to offer “one-click optimization” and similar promises. But the important thing is to avoid unnecessary or bloated software.
Running maintenance scripts on Mac won’t require a heavy app, or an expensive solution. It’s a fairly basic set of operations. So, finding a free program to handle everything for you should be no problem.
Step 1: Download the Application
One such application that makes running maintenance scripts easy, is CleanMyMac X. While they offer a free and paid version, the free model is enough to run maintenance scripts. Another popular app for running maintenance scripts is called Onyx, but we’ll perform these steps with CleanMyMac X instead.
Download and install CleanMyMac X. Once you have it on your computer, launch the app.

©History-Computer.com
Step 2: Launch the App and Select Options
Locate Maintenance from the options on the left sidebar. Click it and select Maintenance Scripts from the available options. Finally, hit Run, and the app will take care of the rest.

©History-Computer.com
Here’s a video walkthrough of how to run maintenance scripts using a third-party app:
Should You Run Maintenance Scripts?
For context, these scripts aim to clean things up, like temp files, that might pile up over time. They also monitor and log the system status and contribute to the creation and maintenance of various parts of the system.
Interestingly enough, most of these scripts are a bit outdated, tending to relate to components that aren’t heavily used or even exist in contemporary versions of macOS. There’s an exception though; the script called /etc/periodic/daily/110.clean-tmps is still quite relevant as it’s responsible for cleaning up temporary files.
What happens is these scripts are a bit of a legacy system from when macOS, back when it was called Mac OS X, inherited its system from FreeBSD. In today’s versions of macOS, Apple tends to approach cleanup and maintenance in a slightly different manner, leaving these scripts somewhat redundant.
Each script loads settings from /etc/defaults/periodic.conf, plus /etc/periodic.conf and /etc/periodic.conf.local, which don’t typically exist by default.
So, what about the daily scripts?
Well, they do various tasks from deleting old files in /tmp, removing old “system messages”, to checking local disk space and network interfaces. Some of them also manage functions that are barely used today, like the msgs and ac commands.
What about weekly scripts?
There used to be a script, 320.whatis, that created and updated a database for man pages. However, it’s gone missing sometime between different macOS versions. Now, there’s just the 999.local script that runs /etc/weekly.local if it exists for backward compatibility purposes.
And finally, the monthly scripts?
They rotate old fax logs, deal with the system accounting system that’s almost never used, and, like its daily and weekly counterparts, have a 999.local script that executes /etc/monthly.local if it exists.