Big Sur: Time Machine Terminal command not working properly (?)

Part of my regular maintenance procedures is deleting remnants from old backups in Time Machine that may have remained after deleting them via the TM GUI. I use the "tmutil" command in the Terminal to do this. In previous versions of macOS, the delete option works properly, and I'm shown how much total space was freed up after the operation. Now, the operation stops right away & always shows "Total deleted: Zero KB".


Any assistance or advice would be appreciated.

MacBook Pro with Touch Bar

Posted on Nov 13, 2020 4:59 PM

Reply
Question marked as Top-ranking reply

Posted on Dec 26, 2020 11:31 PM

I'm on Big Sur 11.0 Mac Mini M1. The backups are on an external Mac OS extended (journaled) drive and stem from the previous system.

I managed to delete backups in bulk using the following commands in Terminal:


sudo su

tmutil listbackups | grep 2019- | xargs -n 1 tmutil delete -d /Volumes/my_mountpoint -t


Replace my_mountpoint with your backup mountpoint as it appears in Terminal.


tmutil listbackups | grep 2019- produces a list of backup timestamps from 2019.

Replace 2019- with your pattern. For instance 2020-11- for November 2020.


xargs -n 1 calls tmutil delete for each item on this list.

With the -n1 parameter of xargs the command passed to xasrgs is called separately for each individual item on the list rather than one time for the whole list.


Similar questions

15 replies
Question marked as Top-ranking reply

Dec 26, 2020 11:31 PM in response to filjedi

I'm on Big Sur 11.0 Mac Mini M1. The backups are on an external Mac OS extended (journaled) drive and stem from the previous system.

I managed to delete backups in bulk using the following commands in Terminal:


sudo su

tmutil listbackups | grep 2019- | xargs -n 1 tmutil delete -d /Volumes/my_mountpoint -t


Replace my_mountpoint with your backup mountpoint as it appears in Terminal.


tmutil listbackups | grep 2019- produces a list of backup timestamps from 2019.

Replace 2019- with your pattern. For instance 2020-11- for November 2020.


xargs -n 1 calls tmutil delete for each item on this list.

With the -n1 parameter of xargs the command passed to xasrgs is called separately for each individual item on the list rather than one time for the whole list.


Nov 23, 2020 12:45 AM in response to Robert Royar

By running the "tmutil listbackups" command, and comparing the results to the folders viewable in Finder, some of the folders aren't included in the list produced by the listbackups command. So, I used a combination of "tmutil delete" and "rm -rf" in Terminal and folder deletion + Empty Trash in Finder to remove the old backups. Thanks for all the suggestions & tips 👍🏼

Dec 28, 2020 10:49 AM in response to filjedi

The Big Sur syntax appears to have changed, but you need to specify the volume and the timestamp with -d and -t:


sudo tmutil delete -d /Volumes/Time\ Machine -t 2020-11-18-100936 


You don't need to specify the Backups.backupdb folder or the backup machine. I had done tmutil setdestination /Volumes/Time\ Machine previously (where Time Machine is the name of your drive.)

Nov 18, 2020 11:18 AM in response to filjedi

I saw the same problem. Since this is a new machine with only a few days of backups, and the files are mirrored on another computer and iCloud, I decided to reformat my Time Machine volume as an encrypted APFS volume. After doing so and letting four backups run, I issued this command:

sudo tmutil delete -d /Volumes/Time\ Machine -t 2020-11-18-100936

The response was

1 backups deleted

tmutil list backups listed three backups, the one that was absent matched the timestamp I gave delete.

Nov 13, 2020 8:29 PM in response to filjedi

filjedi Said:

"Big Sur: Time Machine Terminal command not working properly (?): [...]In previous versions of macOS, the delete option works properly, and I'm shown how much total space was freed up after the operation. [...] Any assistance or advice would be appreciated."

-------


Provide your Feedback to Apple:

Do your Part: Inform Apple of your feedback. Apple wont get back to you directly, but the more feedback thy receive from its users, the more likely they will know what needs to be fixed.

  1. Go Here: Feedback - macOS - Apple
  2. Select: "Feature Request" for the "Feedback Type"
  3. Select: "Application/Utilities" for the "Feedback Area"
  4. Proceed from there as necessary.

Nov 13, 2020 8:32 PM in response to filjedi

filjedi wrote:

Part of my regular maintenance procedures is deleting remnants from old backups in Time Machine that may have remained after deleting them via the TM GUI. I use the "tmutil" command in the Terminal to do this. In previous versions of macOS, the delete option works properly, and I'm shown how much total space was freed up after the operation. Now, the operation stops right away & always shows "Total deleted: Zero KB".

Any assistance or advice would be appreciated.



It would help if you copy and pasted the command line in question...

Dec 30, 2020 2:33 AM in response to asmorris

Hi, apparently the updated syntax only works for backups of the current machine, i.e. those that appear with tmutil listbackups


I have another machine directory for an older Mac (that I don't have any more), that I want to delete in order to reclaim space. While still on Catalina, I successfully used 'tmutil delete' to delete all backups except the latest for that older machine. Now that I have migrated to Big Sur, I want to delete that final last backup (or the machine directory altogether) and it doesn't work anymore.


sudo tmutil delete 2020-08-31-231743

Total deleted: Zero KB


sudo tmutil delete -d /Volumes/Time\ Machine\ 8\ To/ -t 2020-08-31-231743

(null): No such file or directory (error 2)


tmutil listbackups

2020-09-25-075654

2020-10-02-112313

...


That older backup doesn't appear in the list because it is in another machine directory, and the updated syntax (work-around) doesn't work seemingly for that reason.


I have also tried to use the GUI to 'browse other backup disks' (as my older machine directory does appear in the list). But the Time Machine GUI leads me to the current machine directory instead, ignoring the one I selected.


Any idea would be greatly appreciated! I am reluctant to nuke the machine directory with 'sudo rm-fr' because of unknown side effects of bypassing the malfunctioning tmutil utility.


Thanks!

Nov 18, 2020 5:48 PM in response to filjedi

I do the same thing and I am having the same problem as you. I am weary of deleting the backups straight out of Finder as I am not sure if the history will properly collate... However, I did delete my oldest backup folder and it being in the recycle bin now, it takes forever to delete from there. My guess is when deleting from Recycle Bin, it might be reassigning the hardlinks of the files to the next newer backup. At least I hope thats the case and I hope I didnt just screw up my backup history.

Nov 18, 2020 6:17 PM in response to Robert Royar

This actually did work:

sudo tmutil delete -d /Volumes/WD-Passport/ -t 2019-02-22-103759


However, every year I would delete the previous years backups all in one command like this:

sudo tmutil delete /Volumes/WD-Passport/Backups.backupdb/[SystemName]/2019-*


Any idea how to accomplish this using this method? I tried wildcard but that didnt work, like this:

sudo tmutil delete -d /Volumes/Path/ -t 2019-*

Which returned:

2019-*: Invalid argument (error 22)


Ok I may be onto something.... This looks like it should work. Change WD-Passport for whatever your volume is, of course.


for BKUP in $(tmutil listbackups | grep "2019")
do
    echo "Deleting $BKUP"
    sudo tmutil delete -d /Volumes/WD-Passport/ -t $BKUP;
done


Thanks for your help! You definitely put me on the right path. And I know @filjedi will benefit from this as well.


EDIT: I'm still waiting to find out when it hits the 2nd backup, but I think I realized 1 issue. I may have to enter credential for every sudo backup deletion. That means I can't just let it run and it be done in a few hours. ;\

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Big Sur: Time Machine Terminal command not working properly (?)

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.