Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > How to delete files in a Time Machine backup through the terminal

How to delete files in a Time Machine backup through the terminal
Thread Tools
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 3, 2007, 10:31 PM
 
I could not find a good way to disable the ACLs on the backup volume, and since the entire backup set is set to prevent everybody from deleting it (even as root), I suppose to protect the user, it is not possible to manually delete this data. However, if you know what you are doing and want to override this:

Code:
sudo fsaclctl -p /Volumes/<yourVolume> -d
Will disable ACLs on your backup volume. Then you can go in and delete stuff via a simple:

Code:
sudo rm -rf
(these files are all owned by root)


You can use the GUI to delete backup sets as well, but I intend to run scheduled scripts to automate deleting old backups in order to keep the number of files and disk usage on the drive down...
     
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Nov 3, 2007, 10:50 PM
 
Why not just create a partition the size you want Time Machine to use, and let it manage the space? I guess I'm not sure what you're trying to achieve here.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 3, 2007, 11:01 PM
 
I don't want to repartition my disk, and since multiple machines will be backing up to this partition I want more flexibility and want to utilize my disk space as best as I can. I don't think it is possible to shrink partitions, only grow them, right? In order to grow them, there needs to be some unutilized space, and like I said, I prefer to utilize my entire disk, but this data needs to coexist with other data on the disk.
( Last edited by besson3c; Nov 3, 2007 at 11:12 PM. )
     
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Nov 4, 2007, 12:48 AM
 
Originally Posted by besson3c View Post
I don't want to repartition my disk, and since multiple machines will be backing up to this partition I want more flexibility and want to utilize my disk space as best as I can. I don't think it is possible to shrink partitions, only grow them, right? In order to grow them, there needs to be some unutilized space, and like I said, I prefer to utilize my entire disk, but this data needs to coexist with other data on the disk.
I think Live Partition Resizing in Disk Utility in Leopard goes both ways... for example it can shrink your HFS partition to make room for a Windows partition.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 4, 2007, 01:23 AM
 
Originally Posted by mduell View Post
I think Live Partition Resizing in Disk Utility in Leopard goes both ways... for example it can shrink your HFS partition to make room for a Windows partition.
Well, the other problem with this suggestion for me is that my backup volume is an ext3 volume. Disk Utility does not support any other file system type other than HFS+, possibly UFS, and possibly ZFS.
     
Senior User
Join Date: Nov 2002
Location: US
Status: Offline
Reply With Quote
Nov 4, 2007, 10:35 AM
 
Originally Posted by besson3c View Post
Well, the other problem with this suggestion for me is that my backup volume is an ext3 volume. Disk Utility does not support any other file system type other than HFS+, possibly UFS, and possibly ZFS.
Does that mean Time Machine works with ext3?
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 4, 2007, 12:36 PM
 
Originally Posted by fortepianissimo View Post
Does that mean Time Machine works with ext3?
When used with Netatalk, sure (TM works with NTFS via Samba too)
     
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Nov 16, 2007, 10:57 AM
 
You can manually remove files from the backup using the Finder's Action menu while within Time Machine. No need to hack around with the Terminal.
     
Professional Poster
Join Date: Oct 2001
Location: Pacific Northwest
Status: Offline
Reply With Quote
Nov 16, 2007, 11:47 AM
 
Originally Posted by besson3c View Post
I could not find a good way to disable the ACLs
Not to derail, but what is an ACL? I see this term after I repair permissions everytime, multiple times.
     
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Offline
Reply With Quote
Nov 16, 2007, 11:50 AM
 
Access Control List. Leopard uses it in many places to provide greater flexibility over conventional Unix permissions we used to be restricted to.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
Addicted to MacNN
Join Date: Aug 2004
Location: FFM
Status: Offline
Reply With Quote
Nov 16, 2007, 11:51 AM
 
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 16, 2007, 01:28 PM
 
Originally Posted by Big Mac View Post
Access Control List. Leopard uses it in many places to provide greater flexibility over conventional Unix permissions we used to be restricted to.
Yes, ACLs are available under other Unix OSes too... It is not an exclusive or unique Leopard thing, just in case anybody thought otherwise. I'm not even sure if Leopard's ACL implementation was written by Apple...
     
Professional Poster
Join Date: Jun 2001
Location: Northwest Ohio
Status: Offline
Reply With Quote
Nov 16, 2007, 01:46 PM
 
Originally Posted by besson3c View Post
...but I intend to run scheduled scripts to automate deleting old backups in order to keep the number of files and disk usage on the drive down...
I'm not so sure it's a good idea to delete backup sets out from underneath Time Machine without it knowing about it. As I understand it, when a new backup set is taken another set of links for unchanged files is created.

What if you delete a backup set that has real files in it (not links, because the file changed) and subsequent backups link to that real file that your script just deleted?

What's wrong with Time Machine's own, automated management of backups?

I hope you know what you're doing, or one day when you need to restore from a backup, you may find some files not restorable because you deleted real files, and not just links.
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Nov 16, 2007, 01:52 PM
 
Originally Posted by Person Man View Post
I'm not so sure it's a good idea to delete backup sets out from underneath Time Machine without it knowing about it. As I understand it, when a new backup set is taken another set of links for unchanged files is created.

What if you delete a backup set that has real files in it (not links, because the file changed) and subsequent backups link to that real file that your script just deleted?

What's wrong with Time Machine's own, automated management of backups?

I hope you know what you're doing, or one day when you need to restore from a backup, you may find some files not restorable because you deleted real files, and not just links.

Well, I'm not using TM right now because the interface doesn't recognize network backups to a disk image over AFP, and AFP is also painfully slow.

However, reread the Ars Technica and AppleInsider TM reviews. Hard links are simply pointers to the place on a disk where the file is stored. You can have multiple hard links pointing to the same file, and can delete one link without deleting the file itself. As long as there is one link to the file somewhere, the file will continue to be accessible.

I tested this approach with a backup to a external drive and it seemed to work fine.
     
Professional Poster
Join Date: Jun 2001
Location: Northwest Ohio
Status: Offline
Reply With Quote
Nov 16, 2007, 02:26 PM
 
Originally Posted by besson3c View Post
However, reread the Ars Technica and AppleInsider TM reviews. Hard links are simply pointers to the place on a disk where the file is stored. You can have multiple hard links pointing to the same file, and can delete one link without deleting the file itself. As long as there is one link to the file somewhere, the file will continue to be accessible.

I tested this approach with a backup to a external drive and it seemed to work fine.
I read the articles, but that's not the problem I'm talking about. Are you just deleting individual files (links) or whole folders? If it's whole folders, you could still delete real files. Example:

Main drive has 10 files, numbered 1-10. You make your first backup on 11/16/07. The backup drive has folder (11/16/07) with the actual files stored on it. For the next ten days, no changes are made to the files. Folders (11/17/07) through (11/26/07) all contain links back to the files in folder (11/16/07). On 11/27/07, you change file 6. Let's call it 6a. So the backup folder for (11/27/07) would contain links to files 1-5 and 7-10 in (11/16/07) and a real file 6a. Then backups 11/28/07 and later have links to 1-5 and 7-10 in (11/16/07) and links to 6a in (11/27/07)

Then you delete the 11/27/07 backup. You just lost file 6a, because it didn't contain a link to file 6 in the original backup because it was a different file, and therefore copied. Now all backups after 11/27/07 are invalid because they have links to 6a in the backup you just deleted.

I'm not talking about deleting links. Subsequent backups are going to be a mix of links and files because of changes made to files.

Does this (admittedly confusing) example make sense? I could try to do it graphically.
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -4. The time now is 07:58 AM.
All contents of these forums © 1995-2015 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2015, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2