Created
March 6, 2015 03:32
-
-
Save smhmic/dce92ffa89dcc59acf26 to your computer and use it in GitHub Desktop.
Regain direct access to Time Machine backups from old/other computer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# USAGE: reset_permissions_on_time_machine TIMEMACHINE_HD_NAME OLD_COMPUTER_NAME | |
function reset_permissions_on_time_machine(){ | |
echo | |
TIMEMACHINE_HD_NAME="$1" | |
OLD_COMPUTER_NAME="$2" | |
if [ -z "$TIMEMACHINE_HD_NAME" ]; then | |
echo "USAGE: reset_permissions_on_time_machine TIMEMACHINE_HD_NAME OLD_COMPUTER_NAME" | |
echo "Choose the name of the Time Machine disk:" | |
ls -1 /Volumes/ | |
echo | |
return 1 | |
fi | |
if [ -z "$OLD_COMPUTER_NAME" ]; then | |
echo "USAGE: reset_permissions_on_time_machine TIMEMACHINE_HD_NAME OLD_COMPUTER_NAME" | |
echo "Choose the name of the computer's backups to reset:" | |
ls -1 "/Volumes/$TIMEMACHINE_HD_NAME/Backups.backupdb/" | |
echo | |
return 1 | |
fi | |
echo "sudo chmod -R -N '/Volumes/$TIMEMACHINE_HD_NAME/Backups.backupdb/$OLD_COMPUTER_NAME'" | |
sudo chmod -R -N "/Volumes/$TIMEMACHINE_HD_NAME/Backups.backupdb/$OLD_COMPUTER_NAME" | |
# | |
# TODO: why does this produce a few errors like this: ? | |
# chmod: Failed to clear ACL on file xxxxxx.jpg: Operation not permitted | |
# | |
echo && echo "Complete." && echo | |
} | |
reset_permissions_on_time_machine "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment