How Mac OS X should be maintained and maintained

Source: Internet
Author: User
Tags sleep tmp folder file permissions knowledge base

What should be included in the daily maintenance and maintenance of MAC OS X Systems has been controversial. The article on the network is a lot of tricks, less a page, more than more than 10 pages, and even on some issues contradictory to each other, even Apple's own knowledge base of the articles have conflicting places. More comprehensive maintenance and maintenance articles, generally mentioned the following:

1 Running routine maintenance scripts (Scripts)

2 Clear Cache (Caches)

3 Repairing and backing up properties files

4 Cleaning up disk fragmentation (defragment)

5 Repairing Disk Permissions

6 Checking and repairing disks

7 Cleaning the Desktop

8 resetting Safari;

9 Rebuilding the Spotlight database

More specifically, it even prescribes how users should be on a daily, weekly, monthly, and quarterly basis. In terms of content, they actually include the contents of the overhaul and even first aid, as well as a bit of system-optimized content. What is not mentioned above includes daily backups, software and firmware upgrades, and notebook battery software corrections.

In fact, from the user's daily use, after all, the Apple computer is not a car, not like the regular maintenance of the car to the car repair shop, and in addition to some basic maintenance, there is no need for every maintenance of the whole job. More important, if you spend so much time on daily, weekly, monthly, quarterly, or even yearly maintenance in everyday use, these times may accumulate longer than some users ' machine hours. Even system administrators are not likely to live on a regular basis on all the machines they administer. Even I suspect that those who voluminous particularize Mac OS X repair and maintenance are as well maintained as their own machines. The purpose of maintenance and maintenance should be to ensure the current performance of the system, that is, through maintenance and maintenance, so that your Mac OS X can maintain the current performance is sufficient. This may seem easy, but it's not really the case. In other words, from the beginning of the system and software to start, through the use of a period of time, 3 months, six months, a year or even longer, your MAC OS X system can also be similar to the initial installation performance, it means that your machine maintenance and maintenance done quite well. But how many people can do that?

First of all, first of all, to study the frequently mentioned maintenance and maintenance measures, to see when should use these steps, and then summed up to see what the user should do on a daily basis.

 1. Running Routine maintenance scripts (Scripts)

There are several script files under the Unix system, most notably in folders under/etc/periodic/. Previously, because

Unix systems are often the core of the company's or organization's information systems, so they generally do not stop. The design of these scripts

is to clean up the non-stop UNIX. Every 3:15 P.M., the system starts running a daily cleanup script to clean up the system. Depending on the Mac OS x system, these cleanup includes clearing the files in the Crashreporter, tmp folder, removing the junk files, checking the secondary

System status, update system logs, backup NetInfo and ASL logs, and more. The cleanup is completed in the/var/log/folder

Generates the Daily.out file. Every Saturday 3:15 P.M., the system starts to run weekly cleanup scripts for weekly cleanup. The cleanup includes rebuilding the locate and Whatis databases and replacing them with various logs. Finally, the Weekly.out file is generated under the/var/log/folder. The first day of the month 5:30 P.M., the system executes monthly cleanup script, replace the installation log and fax files, and eventually generate Monthly.out. During the replacement log process, the old log files are compressed and the system generates new files, which saves disk space. The entire action mechanism (Leopard) is that the system cron or Launchd first find in the Launchdaemons folder in the system repository under the hard disk, or, and then into usr/sbin/to start Periodic,periodic to/etc/defaults/. Periodic.conf, and then according to the settings of the file, run the phase under/etc/periodic/

Appropriate application in the folder. The time that the app starts is set in the Plist file above. Outside of Leopard

Other versions of Mac OS X have a slightly different working process and cleanup content than Leopard.

Because these script files are written for systems that do not stop, they can complete tasks as scheduled only if your computer is not powered down or hibernating during the preset time. If the running time of these scripts is missed due to the hibernation or shutdown of the machine, it becomes a problem when the next time it is run. In previous versions of Leopard, Launchd was programmed to run the script according to the system timer, and the system timer would not calculate the machine's sleep time, so it would postpone the timed time back, that is, if you were asleep 1:15 P.M., the time to start the cleanup script was 2 hours. When you wake the computer 8 o'clock in the morning, the system still thinks it will take two hours to clean up, so wait until 10 in the morning and you'll find the machine is slow because the machine automatically starts the cleanup script. If you only use 1 or 2 hours of computer each day, it will be difficult to estimate when the machine will be automatically cleaned up. Therefore, it is better to actively run these cleanup scripts after the computer has not been powered on or woken up. Run these scripts by executing the terminal's periodic command or running some third-party software. To use terminal commands, you need to enter:

The sudo periodic script name Script name should be daily, weekly, or monthly. If you want to run three maintenance scripts at the same time, you can enter: sudo periodic daily weekly monthly some third-party software also has this feature. On the Leopard, the situation has changed. When the machine wakes up from sleep, once it discovers that the system is not running the cleanup script in time, it immediately begins to invoke the scripts automatically. As a result, Leopard users have absolutely no need to consider running cleanup scripts themselves.

2. Clear Cache (Caches)

The first thing to figure out is what caching is and what caching is for, before you can consider whether it should be cleaned up regularly.

Computer caches are everywhere, the motherboard has a cache, depending on the model, may be independent of the hardware may also be in the processor

On There is a cache on the hard disk; There are still caches in the file system, and apps such as Safari, also have caches. The Cache itself is a French word, indicating a place for temporary storage. In order to keep the processor from waiting for data while the computer is running, people are building a place where data is temporarily stored. In general, due to the existence of the cache, the system and applications will run faster because of the data stored in the cache. In other words, if the cache is empty, when the system is running, the machine looks at the cache first, and when no relevant content is found, the application is called, and the data and state of the system and application are stored in the cache, a process that is much slower than the data and state that can be found directly from the cache.

But if there is too much or too little space in the cache, some of the content needs to be freed from the cache in order to add new things to the cache when new applications are called or when the amount of data generated by the application is too large. The process itself can be controlled by the machine itself. Of course, if you want to empty the cache artificially, it may be faster than the machine's emptying, but in doing so, you also erase all other apps ' caches, which is bound to affect the performance of those applications. The cache memory on the motherboard, the content disappears when it is shut down, and the cache that is saved to the hard disk as a file will vary depending on the system or application usage. It can be said that there are only a few cases where the cache needs to be artificially cleared. For example, there is an error in the data in the cache, causing the system or application not to function properly. When this happens, as a user you can feel the system or the application is not normal, at this point, you may take other obstacles to eliminate the steps, and empty the cache is also worth considering. From the above analysis, it is not difficult to see that if the data in the cache is not an error, there is no need to empty the cache, and after emptying the cache, it will adversely affect performance. Therefore, this practice should be regarded as a means of fault removal, there is no need to conduct regular routine.

The method of emptying the cache is best used by other apps, rather than being removed step by piece. Can be used Cocktail,

Leopard cache Cleaner or Tiger cache Cleaner.

3. Repair and Backup properties file (plist)

In the system repository, the Preferences of the hard disk resource pool, and the Preferences folder for each user, there is a large

Volume plist file. These files contain the settings of the system or application, and many of the properties files are generated in the use of the application.

Of When an app fails or there is a bug, you can restore the app to its original state by deleting the properties file. In some cases, users personalize the app through pre-fabrication or preference settings (Preferences) under the app interface. These personalization data exist in the plist file of the applicable application. If the app fails and the user deletes its plist file, the app may be restored, but the user's personalization settings for the app are lost. This is the reason why you need to back up the properties file. However, in most cases, the modifiable properties provided by the app itself are limited, and even personalized information is important and difficult to remember, and once the app is set up, it will be done later. As a result, even backups are enough to be backed up again, without regular backups. Therefore, this should not be seen as a routine maintenance step.

4. Defragment disk fragments (defragment)

The computer does not always write data to a persistent sector when it reads and writes data to the disk. After a period of time on the computer, files that are often edited or changed may be scattered across the hard disk in a small piece. The file directory notifies the operating system of the location of these small slices on the hard disk. For the operating system, the file is as full as it is. Cleaning up disk fragmentation copies, connects, and transfers all fragments of a file to a persistent sector, and then rebuilds the file directory. In this way, it is easy to manipulate the system to find files. Cleaning up disk fragmentation is necessary for Windows systems, but it is usually not required for MAC OS X systems. This is because Apple uses a number of techniques to avoid fragmentation as much as possible. First, the hfs+ format avoids the reuse of disk space as much as possible, and secondly, hfs+ volumes can be deferred (Delayed Allocation), that is, when a disk segment (block) faces writing data, the amount of disk space prepared for that data is not counted as free space. But it is not listed in the free space table, and this data is stored in memory, until the system to clear the buffer or the application requires synchronization, only once dumped to the hard disk. In addition, the Apple system uses the "hot-file-adaptive-clustering" technology, that is, to check the gradual increase in the content of the file, once the files are found to be too fragmented, the system automatically cleans up the fragments of the file. In addition, due to the current hard disk capacity, cache and speed increase, many applications for the addition and modification of the file processing, from the previous attached to the file, changed to the current one-time rewrite of the file, so as to avoid the creation of fragments. It should be noted that in order to improve the operating system startup performance, Apple put some files together, if you move them somewhere else, the system will run slowly. In summary, unless the operation and editing of film and television files requires a large amount of uninterrupted disk space to store files, it is not necessary to clean up disk fragmentation on Mac OS X system. If you want to clean up fragments, you can use TechTool Pro or Idefrag.

5. Repair Disk Permissions

Repairing permissions with Disk utility can give you an illusion because it does not fix all the files on the hard disk. For pkg files installed using Apple's installation software (Installer), after the software is installed, the resource library

Leave some marks in the Receipts folder. In previous versions of Mac OS 10.5, this receipts file

The folder will present the Pkg file, and for the installation package of the Packagemaker software using Leopard, it leaves only a BOM file in the Receipts folder and not the pkg file.

When you use Disk utility to repair permissions, the system checks the files in the receipts package, and if it is a pkg file, it will check

Check the file within the package. The BOM file records the permissions of each file and folder when the app is installed. Disk Utility repair Permissions function is to rely on the BOM file to check and modify file permissions. Some people even think that disk tools can only repair Apple's own system and application files, as long as the application in the Receipts folder has a BOM file such receipts, you can check the app is installed file or folder permissions.

In summary, disk utility repair Disk permissions, the role of limited. In general, when you install software updates or third-party software, this can cause a system error because the installed software may need to modify permissions on some system files or folders and do not change the modified permissions back at the end of the installation. In addition, in the case of sudden power outage, improper shutdown, or hard disk damage and other extreme situations, there may be errors, but if this is the case, the entire system may not start, it is not maintenance and maintenance problems. Therefore, after a system upgrade or installation of software (third-party installation software or Apple's installer-pkg file) after installing the new software, need to do the right to repair, only when the failure occurs when the right to repair permissions more appropriate. Of course, if nothing to do, go and fix the permissions on the disk is not much harm.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.