0
1

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 1 year has passed since last update.

【Mac】スリープ解除のスケジュールをコマンドで設定する方法

Last updated at Posted at 2022-10-26

設定方法

pmsetコマンドを使用してスリープ解除のスケジュールを設定します。

繰り返し

繰り返すスケジュールを設定するには以下のように実行します。

sudo pmset repeat 動作 曜日 時間

「動作」には以下を設定できます。

  • sleep
    スリープする。
  • shutdown
    シャットダウンする。
  • wake
    スリープを解除する。
  • wakeorpoweron
    スリープ解除または電源を入れる。
  • poweron
    電源を入れる。

「曜日」は以下の中から実行するものを選択します。
上から月〜日です。

  • M
  • T
  • W
  • R
  • F
  • S
  • U

毎日午前3時にスリープを解除するスケジュールを設定するには以下のように実行します。

$ sudo pmset repeat wake MTWRFSU 3:00:00

$ pmset -g sched
Repeating power events:
  wake at 3:00AM every day

pmset -g schedで現在設定されているスケジュールを確認できます。

また繰り返しのスケジュールを削除するには以下のように実行します。

sudo pmset repeat cancel

単発

繰り返さない単発のスケジュールを設定するには以下のように実行します。

sudo pmset schedule 動作 "日付 時間"

2022年11月1日午前10時にシャットダウンするには以下のように実行します。

$ sudo pmset schedule shutdown "01/11/22 10:00:00"

$ pmset -g sched
Repeating power events:
  wake at 3:00AM every day
Scheduled power events:
 [0]  shutdown at 01/11/2022 10:00:00 by 'pmset'

また単発のスケジュールを削除するには以下のように実行します。

sudo pmset schedule cancel 0

上記の0の箇所にはpmset -g schedを実行した際にスケジュールの先頭に表示される番号を記述します。

コマンドでスリープする方法

以下のコマンドを実行するとすぐにスリープできます。

  • スリープ
pmset sleepnow
  • ディスプレイオフ
pmset displaysleepnow
0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?