Skip to content

Instantly share code, notes, and snippets.

@igreg
Last active January 6, 2019 20:15
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 igreg/9a5409fc65877553b602e8dd543456d2 to your computer and use it in GitHub Desktop.
Save igreg/9a5409fc65877553b602e8dd543456d2 to your computer and use it in GitHub Desktop.
#!/bin/sh
filter='processImagePath contains "backupd" and subsystem beginswith "com.apple.TimeMachine"'
if [ "$1" = "12h" ]; then
# 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"
fi
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