2

I deleted a TimeMachine backup subdirectory with:

rm -rf /Volumes/.../Backups.backupdb/.../2017-06-07-125321

Then later I realized that I could do it better with the standard utility and did this for another subdirectory

sudo tmutil delete /Volumes/.../Backups.backupdb/.../2017-06-07-125444
Password:
Deleting: /Volumes/.../Backups.backupdb/.../2017-06-07-125444
Deleted (44.4G): /Volumes/.../Backups.backupdb/.../2017-06-07-125444
Total deleted: 44.4G

Now, how to I verify that the TimeMachine backup at /Volumes/.../Backups.backupdb/ is still reliable since the first rm ... command I ran, can presumably be destructive in some way?

ProGrammer
  • 2,609
qazwsx
  • 2,561

1 Answers1

2

The Basics
The first command you ran, included the rm -rf flag, this (as you are no doubt aware of) removes the files and folders within the given directory (i.e. recursive deletion). It means that you will no longer be able to recover from this backup. It did not affect the parent (or higher) directories.

The rm command should be used with caution, as you rightfully point out. It can absolutely delete everything (permanently) with one wrong command. I, therefore, recommend to always use the TimeMachine command itself to delete the backup - included since OS X Lion.

Deleting with Time Machine

Terminal:
sudo tmutil delete /Volumes/drive_name/Backups.backupdb/[MAC-NAME]/YYYY-MM-DD-hhmmss

Manually:
As you are concerned with maintaining the interity of the backup setup, you may like to consider using the following method instead (extracted here):

  1. Enter time machine
  2. Select the backup
  3. Right click on the backup (on the finder window)
  4. Select 'Delete Backup' (you may be prompted for a password)

Conclusion
You first command did not affect the root directory to which any past or future backups are/will be stored. You can test it out by going to TimeMachine in the menu bar and selecting Back Up Now, alternatively, you can try to recover to a backup made an hour earlier to discover whether the data is there, it is, because the rm command only removed the contents of the given directory.

Additionally: When rm becomes destructive
It is not unless you are totally new to the command or become complacent in your ability to apply correct procedures with the command, that you begin to make mistakes. If you are interested in some of the donts when using the command, how about this and this article, both make for an amusing read if you have a minute spare.

I hope I was able to interpret your question correctly, do let me know if that made sense to you or if you have any follow-up questions. I'm more than happy to assist where I can.

ProGrammer
  • 2,609
  • From the way you describe the answer especially how disproportionally you talk about 'rm', I actually doubt if you really know what you mean. My concern is not about the permanency of deleting with 'rm' which I'm well aware, instead, it's if the integrity or efficacy of the entire TimeMachine backup in the Backups.backupdb// directory is broken when one subdirectory Backups.backupdb// is deleted with rm. – qazwsx Jan 12 '18 at 00:50
  • The reason for my doubt is that I was suspecting for all the rest Backups.backupdb// to work as a whole to support reverting to some old backup point, the one I deleted with 'rm' is going to be needed. Since I deleted Backups.backupdb// with 'rm' which is entirely independent of the TimeMachine mechanism. I suspect the rest Backups.backupdb// would work any more. I asked this question for a way to confirm if this is the case. – qazwsx Jan 12 '18 at 00:52