I'm trying to delete all backups of specific items through the command line. I can accomplish this using the GUI through the following steps:
- Enter Time Machine
- Navigate to the file to be deleted
- Right click (or click the gear icon in the finder) and choose "Delete all backups of ..."
How can I replicate this on the command line using
tmutil? Especially, when using Backup Loupe to detect large files it'd be easier to use the Terminal (since I don't have to enter TimeMachine at all each time I want to delete a particular file and can navigate to it using the Finder, and then drop it onto Terminal for a command to delete it).
I was hoping I could use something like this:
sudo tmutil delete /path/to/file
however it gives me the error:
"Invalid deletion target (error 22)"`
This works fine:
sudo tmutil delete /Volume/Backups.backupdb/<machinename>
and this too:
sudo tmutil delete /Volume/Backups.backupdb/<machinename>/<specificbackup>
man tmutil the
delete command should also be able to delete specific items. However, I've been out of luck so far. While there are numerous answers on this site (and elsewhere) to delete specific backups with
tmutil and to delete specific backup items through the GUI (using the method described above) I was unable to find any non-GUI way to delete specific backup items.