MacOS – I’ve manually copied files from the time machine backup drive and now I cannot delete them from the computer

backupmacospermissiontime-machine

I got a new computer and I didn't want to do a full time machine restore but rather pick and choose what files I was going to copy off of my time machine drive.

So, I went into the directory, found some files I want, and did cp -Rpv dir /Users/username/dir

However, With the -P it kept the same permissions as the files on the time machine. chmod -R 777 dir doesn't work and neither does resetting permissions from within the 'get info' -> 'sharing and permissions' setting.

How can I get the permissions for the directory back to something that will allow me to delete the directory?

Best Answer

I've sorted it out. First, you need to look at the ACLs that got copied along with the files.

ls -le /path/to/dir

Once you've done that you can see that everything had this:

0: group:everyone deny write,delete,append,writeattr,writeextattr,chown

So, what I did was add a new ACL policy to the directory by doing this:

chmod -R +a "admin allow read,readattr,readextattr,readsecurity" dir 

Followed by:

sudo rm -rf dir