Skip to content

Commit a94bf89

Browse files
committed
New function in run script to show timemachine logs from macOS
🎩 https://superuser.com/a/1129106
1 parent 857c730 commit a94bf89

File tree

1 file changed

+21
-0
lines changed
  • samba-timemachine

1 file changed

+21
-0
lines changed

samba-timemachine/run

+21
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,26 @@ push() {
5353
docker push "timjdfletcher/${IMAGE_NAME}:latest"
5454
}
5555

56+
57+
timemachineLogs () {
58+
filter='processImagePath contains "backupd" and subsystem beginswith "com.apple.TimeMachine"'
59+
60+
# show the last 12 hours
61+
start="$(date -j -v-12H +'%Y-%m-%d %H:%M:%S')"
62+
63+
echo ""
64+
echo "[History (from $start)]"
65+
echo ""
66+
67+
log show --style syslog --info --start "$start" --predicate "$filter"
68+
69+
echo ""
70+
echo "[Following]"
71+
echo ""
72+
73+
log stream --style syslog --info --predicate "$filter"
74+
}
75+
5676
copyToTestHost () {
5777
build --quiet
5878
size=$(docker image inspect samba-timemachine:tmp | jq -r '.[0].Size')
@@ -71,6 +91,7 @@ case ${CMD} in
7191
test) _test ;;
7292
push) push ;;
7393
copyToTestHost) copyToTestHost ;;
94+
timemachineLogs) timemachineLogs ;;
7495
release) release ;;
7596
*) usage ;;
7697
esac

0 commit comments

Comments
 (0)