nlfiedler / timedog

Displays set of files that were saved in Time Machine backups
GNU General Public License v2.0
215 stars 12 forks source link

timedog Legacy Compatibility #22

Open TurtleWilly opened 4 weeks ago

TurtleWilly commented 4 weeks ago
$ timedog
None or only one Time Machine backups found at /usr/local/bin/timedog line 184.

# Note: "-m" switch isn't supported
$ tmutil listbackups -m
Usage: tmutil listbackups

$ tmutil listbackups
/Volumes/Time Machine/Backups.backupdb/Hostname/2024-06-15-173037
/Volumes/Time Machine/Backups.backupdb/Hostname/2024-06-16-120327
/Volumes/Time Machine/Backups.backupdb/Hostname/2024-06-17-092929
/Volumes/Time Machine/Backups.backupdb/Hostname/2024-06-17-120150
/Volumes/Time Machine/Backups.backupdb/Hostname/2024-06-17-123744
/Volumes/Time Machine/Backups.backupdb/Hostname/2024-06-17-125537
…
# Get all available backups
my @backups=`tmutil listbackups -m`;
chomp @backups;
die "None or only one Time Machine backups found" if @backups <= 1;
…

I'm not sure why timedog uses an -m switch/argument, but it seems that's not supported on (older?) versions of tmutil (e.g. under 10.10.5 Yosemite) and hence breaks things. After I fix it up it seemingly works again.

$ sudo sed -i -e 's|tmutil listbackups \-m|tmutil listbackups|g' /usr/local/bin/timedog
nlfiedler commented 4 weeks ago

Thank you for the report. I'll try to track down when this option came into being and see if can be gated on the macOS release. Which macOS release are you using? It is 10.10.5?

TurtleWilly commented 4 weeks ago

@nlfiedler Yes, 10.10.5 (last update was in 2017? :) ). The available tmutil looks "a bit" older at least:

$ tmutil --version
tmutil version 3.0.0 (built Dec 11 2014)