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

1theo0

macrumors member
Original poster
Jul 21, 2012
32
0
Hello! I want to write an applescript to repair the disk permissions each 2 months. I'll save it as an app and open it with iCal, but I need someone to check if my code is ok so that I don't screw up. Thanks! ;)
set errormessage to "Error!"
with timeout of 1800 seconds
try
do shell script "sudo diskutil repairPermissions /" with administrator privileges
do shell script "sudo -K"
on error errormessage
display dialog errormessage
end try
end timeout
activate me
display dialog "Operation Completed!"
 

Red Menace

macrumors 6502a
May 29, 2011
578
226
Colorado, USA
Unless you are having a specific permissions issue, there is no need to repair disk permissions - especially since it does nothing in a user account or for items that were not installed by an Apple installer utility (e.g. dragged from a disk image).
 

1theo0

macrumors member
Original poster
Jul 21, 2012
32
0
I am constantly improving a theme (hence changing files in /System/Library/PrivateFrameworks/CoreUI) and want to make sure everything's all right...;) I don't want to see the prohibitory sign on boot again- once was enough :eek: :D
 

mac-hacks

macrumors regular
Jan 14, 2011
118
0
Swimming In Tsunami
I am constantly improving a theme (hence changing files in /System/Library/PrivateFrameworks/CoreUI) and want to make sure everything's all right...;) I don't want to see the prohibitory sign on boot again- once was enough :eek: :D


why not use bash script. Here mine I have on my Flash Utility Boot Disk.

I named it .drepair and placed it in $HOME

Code:
#!/bin/bash 
echo "Enter Password"
# Ask for the administrator password upfront
sudo v
# Repair Disk Permissions 
diskutil repairPermissions /
# Update share Cache
sudo update_dyld_shared_cache -force
#reboot
sudo shutdown -r +.10
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.