# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1609785328 18000
# Node ID 44f1d686dff1762f7ecb24c620965bb9dd44ab3f
# Parent  b78aa03c0c006591b2cd9bba41b7ab1968380f5a
tm-log: new tool to show time machine logs on macOS

I keep needing this, and it keeps being a hassle.

diff --git a/unixSoft/bin/tm-log b/unixSoft/bin/tm-log
new file mode 100755
--- /dev/null
+++ b/unixSoft/bin/tm-log
@@ -0,0 +1,18 @@
+#!/bin/sh
+
+filter='processImagePath contains "backupd" and subsystem beginswith "com.apple.TimeMachine"'
+
+# show the last 12 hours
+start="$(date -j -v-12H +'%Y-%m-%d %H:%M:%S')"
+
+echo ""
+echo "[History (from $start)]"
+echo ""
+
+log show --style syslog --info --start "$start" --predicate "$filter"
+
+echo ""
+echo "[Following]"
+echo ""
+
+log stream --style syslog --info --predicate "$filter"