Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
14
Help us understand the problem. What is going on with this article?
@AkihiroTakamura

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

More than 3 years have passed since last update.

タイトルのとおりだけど
自分が作業している時はほぼ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 コマンドで少し探してみたけどそれより過去のログの参照方法は今のところ不明

14
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
AkihiroTakamura
仕事でやったことを問題ない範囲で気ままに上げていきます web系多し

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
14
Help us understand the problem. What is going on with this article?