0

I want to use automator or terminal to fetch data from the mac console app.

In particular:

If you search for "sleepwake" in the console app › tab "Mac Analytics Data", you get the timestamps when you woke up the mac from sleep mode.

I want to get those timestamps (e.g. the last one) by some sort of automation.

Any idea?

1 Answers1

0

You can use the a command line call to sysctl to get the last sleep and wake times:

sysctl kern.sleeptime kern.waketime

In my case, the output was:

kern.sleeptime: { sec = 1596154703, usec = 743388 } Fri Jul 31 01:18:23 2020
kern.waketime: { sec = 1596157070, usec = 25 } Fri Jul 31 01:57:50 2020
CJK
  • 436