You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Running Periodic Maintenance Scripts in Mountain Lion

Here's an oldie question that I think has been asked with every new version of Mac OS X. If a user shuts down his Mac in the evening and restarts in at 7AM the next morning, do the three periodic maintenance scripts ever run in Mountain Lion?


It's easy to run them manually in Terminal or even with with an Applescript that I wrote, but do they need to be run under the condition I posed above?


Thanks.

Mid-2011 13-inch MacBook Air-OTHER, OS X Mountain Lion (10.8.2)

Posted on Jan 22, 2013 8:26 AM

Reply
7 replies

Jan 22, 2013 12:59 PM in response to Scott Newman

The way the scripts work has been upgraded significantly over the years.


Apple converted the scripts from cron jobs into launchd scripts, so they don't even work the same way they used to.


Apple also upgraded OS X so that if you sleep or shut down your Mac, causing it to miss overnight maintenance runs, OS X will automatically realize this and will simply run the scripts after it's back up and running. Which means you just don't need to worry about it.


In addition, you have Linc Davis's point which is also good. People used to be concerned about the impact of these scripts when disks were much, much smaller and the performance impact was greater because CPUs were so much slower. That's why they were originally scheduled to be run at an hour when no one was using the computer. Now, due to the power of today's machines and with the way Apple is handling the scripts, these scripts are of no concern to normal users. They can run while you're working and you'll never notice.

Jan 22, 2013 1:21 PM in response to Linc Davis

For those people stating that no one needs to run these scripts or that they're somehow dangerous, please reconsider before posting inaccurate things like that.


I haven't seen anyone stating that the scripts are dangerous. Clearly, they aren't. They are, however, unnecessary if the system is rebooted every day. The only exception is the periodic daily script 100.clean-logs, which deletes symbolic links in /Library/Logs/CrashReporter to crash and panic reports in /Library/Logs/DiagnosticReports older than 60 days. The reports themselves are deleted by a different process. Conceivably, if this script didn't run for a long enough time, the boot volume might fill up with broken symlinks to deleted crash reports. How long would that take?


Well, a symbolic link takes up 77 bytes of storage space. Storage devices, however, allocate space in minimum units of one sector, which is usually 512 bytes. Some of the newer 3 TB hard drives have a 4096-byte sector size. So let's make some worst-case assumptions. Your boot drive is 3 TB, and you have only 1% of that space free, which is 30 GB. You generate 100 crash reports a day -- those being only crashes of system processes, of course, not user processes, which are logged to a different place. So your volume is filling up with symbolic links at the rate of about 400 KB a day. At that rate, it would take only about 75 years to fill it up completely.


So you're quite correct. If your system is always shut down -- not in sleep -- between the hours of 3:15 and 5:30 AM every day, you should manually run 100.clean-logs at least once every 75 years. Let's say once every 25 years, to be on the safe side. Thanks for pointing that out.


Properly Maintain Macbook pro: Apple Support Communities

Running Periodic Maintenance Scripts in Mountain Lion

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.