How can I delete Time Machine files using the commandline

Posted by Tim on Super User See other posts from Super User or by Tim
Published on 2010-07-12T15:50:37Z Indexed on 2011/11/23 2:00 UTC
Read the original article Hit count: 198

Filed under:
|
|

I want to delete some files/directories from my Time Machine Partition using rm, but am unable to do so. I'm pretty sure the problem is related to some sort of access control extended attributes on files in the backup, but do not know how to override/disable them in order to get rm to work. An example of the error I'm getting is:

% sudo rm -rf Backups.backupdb/MacBook/Latest/MacBook/somedir
rm: Backups.backupdb/MacBook/Latest/MacBook/somedir: Directory not empty
rm: Backups.backupdb/MacBook/Latest/MacBook/somedir/somefile: Operation not permitted

There are a number of reasons I do not want to use either the Time Machine GUI or Finder for this. If possible, I'd like to be able to maintain the extended protection for all other files (I'd like not to disable them globally, unless I can re-enable once I've done my work).

© Super User or respective owner

Related posts about osx

Related posts about command-line