Maintenance scripts, whats that all about?

In this case I do not actually have a problem, but have heard about on other forums recently something about scripts running in the middle of the night, assuming you leave your computer on that somehow magically keep your Mac working properly. I did a search on the apple forums for this but to no avail.

Anyone know what this is about? Does it actually work, and if so why?

From my perspective it seems like one could cause more problems by always leaving a pc on, due to power failures or surges etc.

Thanks in advance for some insight on this, or links where I could learn more.

G5 OS 10.4.8, G4 PB OS 10.4.7, Mac OS X (10.4.7)

Posted on Oct 22, 2006 7:56 AM

Reply
12 replies

Oct 22, 2006 8:23 AM in response to Rob Outlaw

Yes, the Keebler elves are busy late at night keeping the computer problem free!

There are three maintenance scripts that Unix runs on a daily, weekly, and monthly schedule. The scripts are run automatically between 3 and 5 am provided the computer is turned on and not sleeping. The scripts perform certain general maintenance chores such as deleting old log and temporary files, rotating the logs, and updating the lookup database.

These maintenance activities prevent log files from growing to unwieldy size which also tends to keep the logs from becoming corrupted. This does help keep OS X running smoother, but they hardly keep OS X completely free of problems. Other efforts are needed:

Kappy's Personal Suggestions for OS X Maintenance

For disk repairs the best third-party utility is Disk Warrior. DW only fixes problems with the disk directory, but most disk problems are caused by directory corruption. However, DW is not yet compatible with Intel Macs. TechTool Pro provides additional repair options including file repair and recovery, system diagnostics, and disk defragmentation. TechTool Pro 4.5.1 is Intel Mac compatible.

OS X performs certain maintenance functions that are scheduled to occur on a daily, weekly, or monthly period. The maintenance scripts run in the early AM only if the computer is turned on 24/7 (no sleep.) If this isn't the case, then an excellent solution is to download and install a shareware utility called Macaroni that will automate the maintenance activity regardless of whether the computer is turned off or asleep.

OS X automatically defrags files less than 20 MBs in size, so unless you have a disk full of very large files there's little need for defragmenting the hard drive. As for virus protection there are few if any such animals affecting OS X. You can protect the computer easily using the freeware Open Source virus protection software ClamXAV. Personally I would avoid most commercial anti-virus software because of their potential for causing problems.

I would also recommend downloading the shareware utility TinkerTool System that you can use for periodic maintenance such as removing old logfiles and archives, clearing caches, etc.

For emergency repairs install the freeware utility Applejack. If you cannot start up in OS X, you may be able to start in single-user mode from which you can run Applejack to do a whole set of repair and maintenance routines from the commandline.

When you install any new system software or updates be sure to repair the hard drive and permissions beforehand. I also recommend booting into safe mode before doing system software updates.

Get an external Firewire drive at least equal in size to the internal hard drive and make (and maintain) a bootable clone/backup. You can make a bootable clone using the Restore option of Disk Utility. You can also make and maintain clones with good backup software. My personal recommendations are (order is significant):

1. Retrospect Desktop (Commercial - not yet universal binary)
2. Synchronize! Pro X (Commercial)
3. Synk 6 (Shareware)
4. Deja Vu (Shareware)
5. SuperDuper (Commercial)
6. Carbon Copy Cloner (Freeware - not universal binary.)
7. LaCie SilverKeeper (Freeware - not universal binary)
8. RsynchX 2.1 and PsyncX 2.2.1 (Freeware)

Visit The XLab FAQs and read the FAQs on maintenance, optimization, virus protection, and backup and restore.

Additional suggestions will be found in Mac Maintenance Quick Assist.

Referenced software can be found at www.versiontracker.com and www.macupdate.com.

Oct 22, 2006 10:04 AM in response to Rob Outlaw

I turn my computer off when I go to bed. I run the maintenance scripts myself from the Terminal when I happen to think of it, using this command to run them all in one fell swoop:

sudo periodic daily weekly monthly

hit return, enter password (which is not echoed to the screen), hit return again and go do something else for awhile.

I acutally use the locate database occasionally, so it is nice to have it up to date. And rotating the logs and cleaning out junk is alway nice. If you want to know in detail what is done you can read the output in your Console application, which you launch from your Utilities folder. Click the Logs icon in the upper corner, then click the disclosure triangle in front of /var/logs and then click daily.out to read its output, ditto for weekly.out and monthly.out.

This all does next to nothing in terms of maintenance. But then my experience is OS X doesn't require much maintenance. Before a system update I generally repair permissions and repair disk, backup everything if I haven't already done that, do the update and repair permissions afterwards. That's about it.
Francine

User uploaded file
Francine
Schwieder

Oct 22, 2006 10:04 AM in response to Kappy

Thanks to the both of you, this was exactly what I was looking for and very helpful info.

Currently I do not have problems with any of my computers, but have had in the past a number of issues with my G5, some that are mentioned in these papers and notes.

Recently I was involved on another forum where the debate at times became quite "heated" about whether or not OS 10 takes care of itself, without the help of 3rd party utilities. My argument was utilities like TTP can be and have been very helpful, which I now have and since have had no problems to speak of with the G5. Others argued they were a waste of money and did nothing or even created problems, and all one needed was the OS 10 utility. During the discussions the notion of the scripts running at night taking care of your mac came up. I had never heard of this and wanted to learn more about what really happens and how.

So it appears for the most part if you really know how to check under the hood thoroughly that OS 10 might be able to deal with most situations, but 3rd party utilities still seem to have their useful place.

Thanks again.

G5 OS 10.4.8, G4 PB OS 10.4.7 Mac OS X (10.4.7)

Oct 22, 2006 10:12 AM in response to Francine Schwieder

Thanks Francine,

I only wish my luck with my experience with my G5 had been like yours. It a bit over 3 years old starting out on 10.2 and right out of the shoot it was very problematic. So much so that for the first one and a half years I had it it got to the point of almost never using it. Perhaps it was something I was doing or not doing at the time, but for the most part and especially since installing TTP it purrs right along now.

In any case there has been some abundant and good info here without the hostility.

Thanks

Oct 22, 2006 10:43 AM in response to ali brown

3891

Hi Ali, Rob,

These times since Tiger are true if your Mac never sleeps.
Since 10.4.2 if you put it to sleep at night, the tasks will run delayed by the total sleep time since last reboot.

Yes, Kappy should update his tip,
but I'm very much with Francine, as Mac OS X big maintenance multiple steps are become quite very much almost completely obsolete, now that things have been improved even more.
Harmless though, but overkill.

All your Mac OS X system really needs IMO:
- backup
- at least 15% free space on the boot volume
- the three log scripts once a month
(BTW you can use your Mac while they're running; just don't quit Terminal)
- repair permissions after using an Apple installer or Software Update
- repair disk (Disk Utility from the Mac OS X install DVD) before important updates/upgrades or twice a year

Even defragmentation is a waste of time and defeats Mac OS X smarter HD space dynamic arrangement on-the-fly.

Axl

Oct 22, 2006 11:59 AM in response to ali brown

3893

You're welcome Ali!

" For future reference, do you know where that is documented?"

It is not documented anywhere that I know of.
Please see our discussion about it in the Lounge for all available info and comments.

You can easily test it yourself by running the ls -al /var/log/*.out command day after day, and writing down your sleep times.

Not worth the hassle though.
A very unimportant matter, really.

🙂
Axl

Oct 22, 2006 12:55 PM in response to Rob Outlaw

We're glad to have helped.



Why reward points?(Quoted from Discussions Terms of Use.)
The reward system helps to increase community participation. When a community member gives you (or another member) a reward for providing helpful advice or a solution to their question, your accumulated points will increase your status level within the community.
Members may reward you with 5 points if they deem that your reply is helpful and 10 points if you post a solution to their issue. Likewise, when you mark a reply as Helpful or Solved in your own created topic, you will be awarding the respondent with the same point values.

Nov 22, 2006 5:44 AM in response to AxL

Can anyone tell me if there is a way to reschedule when these maintenance scripts run.

For example, my iMac is almost always running (and not asleep) between 7pm and 11pm, so sometime between there would be more sensible than the early hours of the morning.

I see I can run manually, but would rather have it auto-scheduled (I want a low maintenance computing lifestyle - which is why I bought a mac!!!)

Thanks, Chris

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Maintenance scripts, whats that all about?

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