Repair disk permissions with applescript - MacRumors Forums
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.3) / Xcode 5.1.1 / RubyMotion FTW
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

Similar Threads
thread Thread Starter Forum Replies Last Post
Message in Repair Permissions - Disk Utility? garycurtis iMac 5 Jan 26, 2014 02:21 AM
repair disk permissions taking long time toronado455 OS X 4 Oct 6, 2013 02:06 PM
Verify and repair Disk permissions Grayed out Creativedot iMac 6 Jul 27, 2013 11:43 AM
Can't repair disk permissions Habberkuk OS X 7 Jun 3, 2013 10:57 AM
Repair disk permissions help ceet12 Mac OS X 10.7 Lion 7 Sep 30, 2012 04:02 PM

Forum Jump

All times are GMT -5. The time now is 08:31 PM.

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

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