Keep your Mac Running Fast (OS X) - Use Disk Utility and Maintenance Scripts

From searching the web and trial and error, I have found the following has helped me keep my Mac running smooth.

This tip has worked for me running an Intel MacBook Pro under OS X 10.4.11

There are a few good programs you can download that will clear your history logs and clean out your cache, but if you are like me and just want to take care of it yourself, running this script in your terminal seemed to keep my Mac running fast. In addition to this, clearing your cache and history in Firefox and Safari are helpful as well.

Scheduled Maintenance Script
If you leave your Mac on overnight, this script will run daily, weekly, and nightly for you. But if you are like me and turn your machine off each night, then your script will never run which will result in loss of hard disk space and slow performance.

In order for you to run the script you will need to open Terminal.

  1. Accessing Terminal
  2. Double click your Hard Disk Icon (typically Top Right of your desktop)
  3. Find the Applications icon and click on it
  4. Scroll down and look for the Utilities Folder
  5. You will find a Terminal icon in there
  6. Click on it.

You should now see a command prompt, inside of the command prompt type the following:

sudo periodic daily weekly monthly

Important:
You will be prompted to enter your password, so if you are not the system administrator, you may not be able to complete this operation.

Also, if your system hasn`t run this script ever or in a long time, it could take a long time to finish, you will know when it finishes it when it returns a command prompt, so don`t worry if it looks like the program is stalling, it`s not.

If you are curious when your system last ran scheduled maintenance, type the following into terminal:

ls -al /var/log/*.out

You will get something like this:
-rw-r--r-- 1 root wheel 26880 Mar 15 03:15 /var/log/daily.out
-rw-r--r-- 1 root wheel 605 Mar 10 14:47 /var/log/monthly.out
-rw-r--r-- 1 root wheel 1255 Mar 15 03:18 /var/log/weekly.out

This basically tells you when the script last ran.

Using Disk Utility

Disk Utility is an application available in OS X (10.2+), that allows you to do an assortment of disk utility options.

For performance purposes, it is good practice to Repair your disk permissions periodically. To do,

Go to Applications Folder
Go to Utiiities
Open Disk Utility
Click on the drive you wish to repair permissions on
Click the First Aid Tab
Then click the Repair Disk Permissions button

What does repairing permissions do? Basically, Macs assign permissions to applications and folders. If these permissions get messed up, your applications may run sluggishly or not even open.

Keywords: OS X scripts, OS X, OS X maintenance


Submit a Comment