Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Repair permissions to resolve slow system issues' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Repair permissions to resolve slow system issues
Authored by: DanFrakes on May 31, '03 02:26:00AM

Repair Permissions via the diskutil command requires an admin password to run (i.e., it has to be run as root). You'd need to set up a shell script or AppleScript that includes a password. I've set up an AppleScript that runs Repair Permissions every Saturday morning and outputs the log to my Desktop.

---
------------------------------------------
Mac OS X Power Tools:
http://www.macosxpowertools.com/



[ Reply to This | # ]
Repair permissions to resolve slow system issues
Authored by: Alrescha on May 31, '03 10:23:53AM

"You'd need to set up a shell script or AppleScript that includes a password."

That isn't always a good idea. If you have set a root password, just set up the crontab entry as root.

A.



[ Reply to This | # ]
Repair permissions to resolve slow system issues
Authored by: DanFrakes on Jun 01, '03 03:29:55PM

If you keep the script in your own user directory, it's not a problem (Anyone who can get into your user directory to access the script already has enough access that getting your password isn't going to matter much ;))

I agree that keeping it elsewhere is a security risk.


Porkchop, I realize that diskutil is a command-line program, and that AppleScript isn't "needed." But you can use AppleScript to run command-line programs, and running an AppleScript via cron is an easy way to set up a schedule like this without having to edit the root/system crontab (i.e. you can run it from a user-level crontab, which is preferred to editing the root/system crontab).

---
------------------------------------------
Mac OS X Power Tools:
http://www.macosxpowertools.com/



[ Reply to This | # ]
Root password needed?
Authored by: porkchop_d_clown on May 31, '03 02:24:47PM

Ummmm... cron jobs are already run as root, and diskutil is a command line version of the disk utilitiy. Applescript isn't needed.

The only real problem with cron is you have to leave your machine running 24 hours a day, which is why I use anacron instead.

---
Everyone loves a clown, but no one will lend him money!



[ Reply to This | # ]
Root password needed?
Authored by: Alrescha on May 31, '03 05:30:03PM

"Ummmm... cron jobs are already run as root.."

Unless Darwin/OS X acts differently than all other unixes that I have experienced, cron jobs run as the user who added them. This is not necessarily root.

A.



[ Reply to This | # ]
Root password needed?
Authored by: MacTed on May 31, '03 09:39:57PM

First, you don't need to set up the Root password -- just sudo, and use your regular password to authenticate as an Administrator.

Second, you can write a brief shell script to run the necessary commands, and sudo cron to make it all come out right....

Be seeing you,

Ted

---
Support Consultant - Mac Specialist, OpenLink Software

[ Reply to This | # ]

Root password needed?
Authored by: greed on Jun 02, '03 10:36:03AM

And you can always add something like:

username ALL=(root) NOPASSWD:/usr/sbin/diskutil

to your "sudoers" file. (See visudo and sudoers manpages for more fun. I mean detail.)

Then you can "sudo diskutil" when logged in as "username" without having to enter the password.



[ Reply to This | # ]