用 pmset repeat 设置定时唤醒或睡眠
用终端里的 pmset repeat 让 Mac 每天在固定时间自动唤醒、睡眠或关机。
运行 sudo pmset repeat wake MTWRFSU 07:00:00 即可让 Mac 每天早上 7 点自动唤醒;用 sudo pmset repeat cancel 可取消计划。
01命令
命令
$ sudo pmset repeat wake MTWRFSU 07:00:0002作用说明
pmset repeat 会把一条重复的电源事件写入 Mac 的电源管理计划器,和“节能”设置里的定时开关机是同一套机制。星期字母代表周一到周日(M T W R F S U),所以 MTWRFSU 表示每一天。在 Apple 芯片和较新的笔记本上,要触发唤醒事件,Mac 需要接通电源或处于睡眠(而非完全关机)状态。
03风险
!注意: 系统只允许一组重复事件,设置新的 repeat 计划会覆盖旧的;如需更换备份时间窗口,先用 sudo pmset repeat cancel 取消原计划。
04撤销
撤销
$ sudo pmset repeat cancel05来源
- pmset(1) macOS man page依据: The man page states that 'repeat' is for setting up daily/weekly power on and power off events, with examples like 'pmset repeat shutdown TWRFS 11:00:00'.
- pmset - Power management settings依据: Shows the syntax 'pmset repeat {sleep | wake | poweron | shutdown | wakeorpoweron} weekdays "HH:mm:ss"' and the example 'sudo pmset repeat restart MTWRFSU 00:00:00' plus 'pmset repeat cancel'.
最后验证: 2026-09-19 · 分类: 系统与设置