Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Nov 17, 2012, 07:41 PM   #1
1theo0
macrumors member
 
Join Date: Jul 2012
Repair disk permissions with applescript

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!
Quote:
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!"
__________________
MacBook White 4,1 2010 model
1theo0 is offline   0 Reply With Quote
Old Nov 17, 2012, 09:05 PM   #2
Red Menace
macrumors regular
 
Join Date: May 2011
Location: Littleton, 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).
__________________
MacBook Pro / OS X Mavericks (10.9.2) / Xcode 5.1 / [and various (much) older stuff keeping dust off the shelves]
Red Menace is offline   0 Reply With Quote
Old Nov 17, 2012, 09:12 PM   #3
1theo0
Thread Starter
macrumors member
 
Join Date: Jul 2012
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
__________________
MacBook White 4,1 2010 model
1theo0 is offline   0 Reply With Quote
Old Dec 2, 2012, 09:52 PM   #4
mac-hacks
macrumors regular
 
Join Date: Jan 2011
Location: Swimming In Tsunami
Quote:
Originally Posted by 1theo0 View Post
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

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
mac-hacks is offline   1 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 11:08 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC