Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

EGT

macrumors 68000
Original poster
Sep 4, 2003
1,605
1
Do you repair permissons every time you install/uninstall software, or leave to a weekly or monthly thing?

What exactly does repairing permissons do? I'm a bit confused by it all.

Thanks
 
I repair permissions about once a month. If I install a big program I do it afterwards too. But usually only one or two permissions are faulty.

As to what it does exactly... I could give you some real unscientific, stupid sounding but easy to understand explanation or I could just leave it to someone who understands what the hell they're talking about. :D
I'll just choose the latter. ;)
 
I never repair permissions... maybe I'm stupid... but it all sound so weird... I don't know what the (dis)advantage is... so I don't do **** with it... and all works fine...
 
Jo-Kun said:
I never repair permissions... maybe I'm stupid... but it all sound so weird... I don't know what the (dis)advantage is... so I don't do **** with it... and all works fine...

Disadvantages can be crashing programs, worse performance of the OS or the OS crashing itself, IF there are faulty permissions AND they interfere with sth. critical.
 
Once every week or so, I run the following script:

echo "Performing daily maintenance..."
sudo periodic daily
echo "Performing weekly maintenance..."
sudo periodic weekly
echo "Performing monthly maintenance..."
sudo periodic monthly
echo "Repairing permissions..."
sudo diskutil repairPermissions /
echo "Updating prebinding..."
sudo update_prebinding -root / -force
echo "Done!"

which I've named 'maint' and made executable. Keeps my old PB, which isn't on all the time, in tip-top shape. I also run in on my G5, which usually is[/] on, if it's skipped on of it's scheduled maintenance scripts due to a power outage, etc.
 
So if I copy and paste that into (where?), then it would do it without going to Disk Utility? Would it repair permissions once a day/week/month automatically, because that wouldn't be what I want.

Anyway, I repair disk permissions every time I install an application, so I rarely ever do. :)
 
About once every two weeks, along with optimizing the system and cleaning up the logs and caches. (using Onyx) . . . so far running smooth. (after 1.25 years, original OS install)
 
Abstract said:
So if I copy and paste that into (where?), then it would do it without going to Disk Utility? Would it repair permissions once a day/week/month automatically, because that wouldn't be what I want.

Anyway, I repair disk permissions every time I install an application, so I rarely ever do. :)

Open up Applications->Utilities->Terminal. This will open a terminal in your home account.

Type 'touch maint' [the part between the single quotes] at the prompt, and hit return (don't mean to offend if I'm over-simplifying for you - but maybe someone else will read this and need the details). The 'maint' part is the name of the script you'll be creating - you can call it whatever you want; I just call it 'maint'.

Now, in Finder, navigate to your home directory, find the file you just created ('maint' inthe above example) and right (or control) click on it to "Open With..." TextEdit. In TextEdit, cut the script above and paste it into the file.

Since each command is preceded by an echo statement saying what its going to do, you can feel free to cut out stuff you don't want. In other words, if all you want to do is repair permissions, just leave in that part - although it's as easy to use Disk Utility as it is to run a one-line script. Of course, if you Google 'cron OS X' you'll find tips on how to alter your cron table (which runs stuff automatically at specified times) and, say, repair permissions once a day by running this script you just created.

Then save the file from TextEdit.

Back in the terminal window, type in 'chmod u=rwx maint' and hit return. Of course, replace 'maint' with your name if you've called it something else. This command allows you to execute the script (run it).

To run the script, simply open Terminal at any point, go to your home directory (which is where Terminal opens to by default, so you only need to go there if you've gone elsewhere in a Terminal window) and type './maint' and hit return.

Note: if you update the pre-binding, it's a very good idea to restart the system afterwards.
 
I use cocktail which someone on this board recommended. It has a "Pilot" mode that runs through all sorts of stuff, including permissions ,which I run generally once a week.

However, I like yourself am interested to know what exactly "Permissions" are and why they need regular maintenance.

Vanilla
 
Vanilla said:
However, I like yourself am interested to know what exactly "Permissions" are and why they need regular maintenance.

Permissions are what tell OS X who is allowed to do what to a given file - "who" being divided into the owner, the group the owner is in, and the "world"; and "what" being, essentially, the ability to read and/or write and/or execute the file.

If permissions are messed up, files which need to be accessed or used by applications might not be as accessible or usable as they need.

As to why you need it... I've wondered that myself. I'd think OS X wouldn't get so messed up so often that it needs it, but perhaps it's a consequence of lots of different apps installing lots of different things. I don't recall ever needing to repair permissions on my Sun box at work. Maybe it was done automagically.
 
jsw said:
Once every week or so, I run the following script:

echo "Performing daily maintenance..."
sudo periodic daily
echo "Performing weekly maintenance..."
sudo periodic weekly
echo "Performing monthly maintenance..."
sudo periodic monthly
echo "Repairing permissions..."
sudo diskutil repairPermissions /
echo "Updating prebinding..."
sudo update_prebinding -root / -force
echo "Done!"

which I've named 'maint' and made executable. Keeps my old PB, which isn't on all the time, in tip-top shape. I also run in on my G5, which usually is[/] on, if it's skipped on of it's scheduled maintenance scripts due to a power outage, etc.


I do the same thing, but with a little app named "Cocktail." It performs all these tasks and a lot more. You can find a demo on VersionTracker. The full version costs $10.
 
tfaz1 said:
I do the same thing, but with a little app named "Cocktail." It performs all these tasks and a lot more. You can find a demo on VersionTracker. The full version costs $10.

Pretty cool - I'd heard about it, but just checked the info on VersionTracker now. Might have to get it! However, it's nice to write the occasional script as well just to see what's running under the hood....
 
Note:

If you run the script I posted above, or any script containing 'sudo' (which means "super-user do"), you'll need to enter an admin password when you run it - which, presumably, yours qualifies as, maybe unless you're using someone else's Mac).

Once entered, the password is good for ~5 minutes, so, if a script containing multiple 'sudo' commands takes more than 5 minutes between commands, you'll need to re-enter the password.
 
thanks jsw, sure i knew how to do the sudo tasks but i had no idea how to write a script to do it for me. Do you know of anywhere else i can go to learn more about apple scripting? what sort of other usesul things do you do with it?
 
If you install something that requires an admin password, repairing permissions afterwards isn't a bad idea. Naturally if you're installing a buncha things, you can wait until they are all installed and then repair permissions. Otherwise, repairing permissions is a task that people use to make themselves feel better but accomplishes nothing..
 
stevehaslip said:
thanks jsw, sure i knew how to do the sudo tasks but i had no idea how to write a script to do it for me. Do you know of anywhere else i can go to learn more about apple scripting? what sort of other usesul things do you do with it?

Best source for AppleScript:

"AppleScript: The Definitive Guide"

I own it, but have just started looking into it (the book, and AppleScript in general).

However... note that the above script is a UNIX script, not an AppleScript script. Same word, different connotations. For UNIX scripting, I'm sure there are plenty of on-line resources. I've picked up some knowledge over the years, but not much.
 
I always repair permissions before installing anything via Software Update, which means it gets done on my machine at least once a month. I've never had any problems, but I just play it safe anyway. Back on OS X 10.1, I never repaired permissions (I didn't know about it at the time), but I never had problems there either.

I think Software Update should repair permissions automatically before installing OS point upgrades (10.3.4, 10.3.5, etc). Maybe in a future OS version (maybe even in Tiger..?).
 
Hoef said:
Hey,
Still learning my way around the Mac .... How would a user know that a cron "thingy" was done at night?
Tx!

It depends on which cron "thingy" you're talking about. If it's the daily/weekly/monthly scripts, then there will be logged entries in:

/var/log/daily.out
/var/log/weekly.out
/var/log/monthly.out
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.