View Single Post
  #1  
Old September 3rd, 2004, 12:50 AM
michaelsanford's Avatar
michaelsanford michaelsanford is offline
Psycholinguist
 
Join Date: Oct 2002
Location: Ottawa/Montrιal
Posts: 2,172
Thanks: 0
Thanked 0 Times in 0 Posts
michaelsanford is on a distinguished road
[HOWTO] - Keep permissions up to date automatically.

The underlying BSD subsystem of Mac OS X, Darwin, uses a unix-style permissions system to determine who can see, access, search and execute files, folders and devices.

Installer packages (.pkg and .mpgk) install software and puts files in various locations throughout your filesystem. The Installer also keeps receipts of these installations to facilitate keeping permissions up to date.

Many, many, many seeminlgy random problems in OS X can be caused by permissions problems; repairing permissions is usually the first step recommended in troubleshooting a problem in OS X.

Instead of waiting for a problem to crop up, why not set up your Mac to automatically repair permissions every night ? Here's how (you'll need administrator access) :

1. Open Terminal.app and type sudo pico -w /etc/crontab and enter your password.

2. You should see a file that has contents similar to this:
Code:
# /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour    mday    month   wday    who     command
#
#*/5    *       *       *       *       root    /usr/libexec/atrun
#
# Run daily/weekly/monthly jobs.
15      3       *       *       *       root    periodic daily
30      4       *       *       6       root    periodic weekly
30      5       1       *       *       root    periodic monthly
10      *       *       *       *       root    /sw/sbin/anacron -s
Go to the bottom of the file and add the following line (note: the spaces are tabs!)
Code:
# /etc/crontab
SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
HOME=/var/log
#
#minute hour    mday    month   wday    who     command
#
#*/5    *       *       *       *       root    /usr/libexec/atrun
#
# Run daily/weekly/monthly jobs.
15      3       *       *       *       root    periodic daily
30      4       *       *       6       root    periodic weekly
30      5       1       *       *       root    periodic monthly
10      *       *       *       *       root    /sw/sbin/anacron -s

# Repair Permissions, added by me.
0       1       *       *       *       root    /usr/sbin/diskutil repairPermissions /
This will, every day at 01h00, repair permissions on the startup volume. Change the frequency to whatever you want, to a different time, once a week, whatever.

Alternatively you can use an application like CronniX, instead of the Terminal, to add the line to the system crontab.
__________________
michaelsanford.com • Blog • Twitter • Tumblr • LinkedIn
• iMac Aluminum 24" |
MacOS X 10.5-current | 3.06 GHz Intel Core Duo | 4 GB RAM | 1 TB HDD
• iBook G4 1.42 GHz | MacOS X 10.5-current | 1 GB RAM, 100 GB HDD
• AMD Athlon64 3500+ | Slackware 12 (2.6.21.5-smp) | 2 GB RAM, 2•120 GB RAID 1, 2•500 GB RAID 0
Reply With Quote