Skip to content

Instantly share code, notes, and snippets.

@davidmerrick
Created November 4, 2019 21:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidmerrick/7f6f705f73eecdf56169b07531a0b41c to your computer and use it in GitHub Desktop.
Save davidmerrick/7f6f705f73eecdf56169b07531a0b41c to your computer and use it in GitHub Desktop.
Time Machine log
#!/bin/sh
# This script shows the previous 12 hours of Time Machine activity, then shows live logs
# Reference: https://superuser.com/questions/1126990/how-to-view-time-machine-log-in-macos-sierra
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment