11
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Macで蓋を空けたり閉じたりした時間をログから拾う方法

Posted at

タイトルのとおりだけど
自分が作業している時はほぼMacに向かっており、終わる時は必ず蓋を締めてSleepにしている。
これをログから拾えば作業時間がわかるかもとおもってやってみた

Sleepに入った時間と解除された時間

以下のコマンドからログを見ることができた

sudo pmset -g log | grep "Kernel Idle sleep preventers"

結果はこんな感じ

2017-01-18 10:02:00 +0900 Assertions          	Kernel Idle sleep preventers: IODisplayWrangler          
2017-01-18 21:31:40 +0900 Assertions          	Kernel Idle sleep preventers: -None-          
2017-01-19 10:06:27 +0900 Assertions          	Kernel Idle sleep preventers: IODisplayWrangler          
2017-01-19 11:38:27 +0900 Assertions          	Kernel Idle sleep preventers: -None-          
2017-01-19 11:46:53 +0900 Assertions          	Kernel Idle sleep preventers: IODisplayWrangler          
2017-01-19 12:07:55 +0900 Assertions          	Kernel Idle sleep preventers: -None-          
2017-01-19 12:26:11 +0900 Assertions          	Kernel Idle sleep preventers: IODisplayWrangler          
2017-01-19 12:30:10 +0900 Assertions          	Kernel Idle sleep preventers: -None-          
2017-01-19 13:19:49 +0900 Assertions          	Kernel Idle sleep preventers: IODisplayWrangler          
2017-01-19 20:31:31 +0900 Assertions          	Kernel Idle sleep preventers: -None-          

たぶん開け閉めした時間が記録されてる。
ただ直近15日間くらい?しか出てこなかった。

pmset コマンドで少し探してみたけどそれより過去のログの参照方法は今のところ不明

11
16
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
16

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?