MacNN Forums (http://forums.macnn.com/)
-   Mac OS X (http://forums.macnn.com/mac-os-x/)
-   -   How to delete files in a Time Machine backup through the terminal (http://forums.macnn.com/90/mac-os-x/352973/how-delete-files-time-machine-backup/)

 
besson3c Nov 3, 2007 09:31 PM
How to delete files in a Time Machine backup through the terminal
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...
 
mduell Nov 3, 2007 09: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.
 
besson3c Nov 3, 2007 10: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.
 
mduell Nov 3, 2007 11:48 PM
Quote, Originally Posted by besson3c (Post 3524374)
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.
 
besson3c Nov 4, 2007 12:23 AM
Quote, Originally Posted by mduell (Post 3524444)
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.
 
fortepianissimo Nov 4, 2007 09:35 AM
Quote, Originally Posted by besson3c (Post 3524458)
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?
 
besson3c Nov 4, 2007 11:36 AM
Quote, Originally Posted by fortepianissimo (Post 3524685)
Does that mean Time Machine works with ext3?
When used with Netatalk, sure (TM works with NTFS via Samba too)
 
TETENAL Nov 16, 2007 09: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.
 
Gankdawg Nov 16, 2007 10:47 AM
Quote, Originally Posted by besson3c (Post 3524355)
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.
 
Big Mac Nov 16, 2007 10: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.
 
TETENAL Nov 16, 2007 10:51 AM
 
besson3c Nov 16, 2007 12:28 PM
Quote, Originally Posted by Big Mac (Post 3535261)
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...
 
Person Man Nov 16, 2007 12:46 PM
Quote, Originally Posted by besson3c (Post 3524355)
...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.
 
besson3c Nov 16, 2007 12:52 PM
Quote, Originally Posted by Person Man (Post 3535390)
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.
 
Person Man Nov 16, 2007 01:26 PM
Quote, Originally Posted by besson3c (Post 3535397)
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. :)
 
All times are GMT -4. The time now is 12:27 AM.

Copyright © 2005-2007 MacNN. All rights reserved.
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2015, vBulletin Solutions, Inc.


Content Relevant URLs by vBSEO 3.3.2