前面有介绍TimeMachine命令行下使用来备份删除旧备份等操作,是针对MacOS11以下的版本,详见:https://blog.terrynow.com/2021/09/15/macos-timemachine-termial-command-line-usage/
MacOS11 BigSur以及以上版本,试了一下,发现有所改变,整理如下:
# tmutil listbackups 命令可以显示 Time Machine 中的所有备份: $ tmutil listbackups 2020-08-02-231305 2020-10-07-024559 2021-04-30-015300 2021-08-28-070716 2021-09-12-171704 2021-10-06-161126 2021-11-14-141244 # 列出完整路径的备份记录 # tmutil listbackups -m /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2020-10-07-024559 /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2021-04-30-015300 /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2021-08-28-070716 /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2021-09-12-171704 /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2021-10-06-161126 /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2021-11-14-141244 # 查看当前TimeMachine的远程备份信息 tmutil destinationinfo ==================================================== Name : TMBackup Kind : Network URL : smb://[email protected]/TMBackup ID : A8E04C7C-7D78-4940-89A3-D0A4BD28065 # 查看备份在本机的挂载点 tmutil machinedirectory /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac # tmutil delete 命令则可以删除 Time Machine 中的指定备份: $ sudo tmutil delete -p "/Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2020-10-07-024559" Deleting: /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2020-08-02-231305 Deleted (427.2M): /Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2020-08-02-231305 $ tmutil latestbackup # 列出最新的备份
tmutil listbackups的时候,列出的是已备份列表的时间戳(之前MacOS11以前的版本,列出的是类似这样/Volumes/Time Machine Backups/Backups.backupdb/Terry iMac/2020-07-11-120422完整的路径)
所以需要使用tmutil listbackups -m列出完整路径的。
清理旧备份(tmutil delete)的时候,也可以使用的是 delete [-d backup_mount_point -t timestamp] 这样的格式
其中参数-d后面跟着备份的挂载点backup_mount_point,可以先使用tmutil machinedirectory来确定,例如:
sudo tmutil delete -d "/Volumes/Time Machine Backups/Backups.backupdb/Terry iMac" -t 2020-08-02-231305
文章评论