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.

Maintenace routines in Snow Leopard

I know in past version of Mac OS X, there were daily, weekly, and monthly routines run in the middle of the night. There were nice free apps out there like MacJanitor that was an easy to use interface just to run those and didn't bloat out to anything else.

Does Snow Leopard still run those? Is there a way to use Terminal to run those?

Does Console list when those were last run?

MBP 15-inch 2.66 GHz Intel Core i7 / 4GB SDRAM / AG Screen (Mid 2010), Mac OS X (10.6.6), iPhone 3GS (32GB), AEBS DB II (Late 2009), Apple Wired Keyboard/Mouse, ClamXav 2

Posted on Mar 19, 2011 9:12 AM

Reply
23 replies

Mar 19, 2011 11:58 AM in response to powerbook1701

Unless your computer has been off since January, the monthly scripts should have run.

If open up a Terminal WIndow, you can paste this in it:
sudo launchctl list | grep periodic
Hit return. It will ask for your password.

The return should tell you if it's enabled. 0 for enabled. 1 for disabled.

Addition: If you paste this in terminal, it will tell you when they were last run:
ls -al /var/log/*.out

Message was edited by: Glenn Leblanc

Mar 19, 2011 12:58 PM in response to Glenn Leblanc

in looking at the console log, I see that it was last run December:
Sun Dec 26 18:17:03 EST 2010

I was able to find this kbase:
http://support.apple.com/kb/HT2319?viewlocale=en_US

Mac OS X v10.6 and later information

In Mac OS X v10.6 and later, background maintenance tasks that do not run when the computer is asleep are run after it wakes from sleep mode.

*MINE is usually shut down and not in sleep, so maybe that is why it has not run*



For more advanced information, visit these developer webpages:

http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/ man8/periodic.8.html
http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/m an5/launchd.plist.5.html
Mac OS X v10.4 and v10.5
If your computer is shut down or in sleep at the designated times, the maintenance does not occur. In this situation, you may wish to force the maintenance tasks to run. There are two options: Use a third-party application or Terminal.

Use a third-party application

Some third-party applications may allow you to run these tasks whenever you wish. Four examples include:

Macaroni by Thomas Harrington
Mac Janitor by Brian R. Hill
CronMaster by Dan Klein
weRclean by Parental Advisory
You can search for these or other solutions at VersionTracker ( http://www.versiontracker.com/).

Use the Terminal (advanced)

Note: As mentioned above, these steps are not necessary in Mac OS X v10.6 or later.

+Open Terminal (/Applications/Utilities).+
+Type: sudo periodic daily+

+Tip: Typing "daily" runs tasks normally scheduled for a daily interval. Type "monthly" or "weekly" in place of "daily" to runs tasks scheduled for those intervals. Weekly tasks usually require a longer time to run than others.+

Press Return.
Enter your Admin password when prompted, then press Return.
Quit Terminal when the task is complete.
Additional Information
The tasks are scheduled for 03:15 to 05:30 in your computer's local time zone. This is described further in "Mac OS X: Unexplained Disk Activity Produced by 'find' Process." These tasks do not run if the computer is shut down or in sleep mode. If the tasks do not run, it is possible that certain log files (such as system.log) may become very large in Mac OS X v10.5 or earlier.


*Do you think this option to enter these commands in terminal for 10.6.6 still works?*

Mar 19, 2011 2:59 PM in response to powerbook1701

OK, now that I have a few more minutes, since you are running OS 10.6, your scripts should run. That's evident because your daily and weekly are running. The monthly should run too, but from what you're saying, it's not.

That's why I asked you to run those commands to see if the monthly was disabled.

sudo launchctl list | grep periodic
That script will show you whether or not they are enabled. We already know daily and weekly are.
Just check to make sure the monthly script is.

Mar 19, 2011 4:20 PM in response to Glenn Leblanc

Thanks for helping. It looks like they are running. Researching a little futher: I have +another MBP running SL+ (different) and checked out the logs in Console to find that the Monthly on that one ran in March, but previous to that hadn't run since October, but the daily and weekly were run recently. It would appear that if the Mac is OFF during that time frame, a script that was suppose to run doesn't. But, if the Mac was in SLEEP MODE, then when it wakes it will run that script that was suppose to run.
I would guess that if ever the files get to big, SL would then run the task regardless. No proof of that, but that is kind of inferred between the lines on that kbase article I found.

Question, however, do the terminal command that are listed in that kbase for 10.4 and 10.5, still work on 10.6? I ask only because that kbase says for SL it is not need (not needed= not work?)

My test will be to put it into sleep on the last day of the month, and see if it runs when I open it up on the 1st..

thoughts?

Message was edited by: powerbook1701

Mar 19, 2011 4:49 PM in response to powerbook1701

Those commands do work on snow leopard. Except for the one that runs the scripts, the other 2 are just read commands.

As far as the monthly, I don't think it's a process of the 1st of the month. Since it's been longer than 30 days, try it overnight and see if it works.

You still haven't said if you tried the command to see if was enabled. At least you will know that it is.
Here is the post when I had a problem. This may help you somewhat.

http://discussions.apple.com/thread.jspa?threadID=2765354&tstart=0

Mar 19, 2011 5:19 PM in response to Glenn Leblanc

sorry, yes the report says it was working. I worked it into my previous post, but didn't do a very clear explanation.
Now that I have really been digging:
http://developer.apple.com/library/mac/#documentation/Darwin/Reference/ManPages/ man8/periodic.8.html

DESCRIPTION
The periodic utility is intended to be called by launchd(8) to execute shell scripts located in the
specified directory.

One or more of the following arguments must be specified:

daily Perform the standard daily periodic executable run. This usually occurs early in the morning (local time).

weekly Perform the standard weekly periodic executable run. This usually occurs very early on Satur-day mornings.

*monthly Perform the standard monthly periodic executable run. This usually occurs on the first day of the month*
-----------------------

The others seem to run when Mac is a sleep and wake after the said time, but no if it is shut down. Looks like the final test will be March 31st into April 1st (hopefully I won't be the fool).

Message was edited by: powerbook1701

Mar 19, 2011 6:19 PM in response to powerbook1701

The monthly script does one thing: it archives old fax logs. If you regularly use your Mac as a fax machine (using a fax modem), then monthly should be run occasionally. If you do not use the fax facility in your Mac, there is never any reason to run monthly.

The other scripts are also pretty trivial. Somewhere along the line, someone applied the term "maintenance" to these scripts, giving people a grossly exaggerated sense of their significance. In early versions of OS X, there were some log files that were archived by these tasks; that is now handled by a separate job that runs hourly.

The periodic scripts are intended for systems that are not restarted for weeks or months. In that case, the scripts will run automatically with no intervention. If you restart (or shut down) the computer often, then there is rarely any reason to run them at all. These scripts are designed to be automatic. End users shouldn't need to do anything about them, and need not even know they exist.

Maintenace routines in Snow Leopard

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