首页 > 解决方案 > 如何获取 macOS Catalina 定期重启的原因?

问题描述

我知道,我的远程 MacOS 每天都会在同一时间(上午 9 点 30 分)重新启动。
节能器仅包含预定于上午 07:45 的“启动或唤醒”。 我通过执行检查了“先前关闭原因”的日志 并得到了答案,这意味着 我试图找出重新启动的真正原因是什么。这里有哪些可能的选择?

在此处输入图像描述


log show --predicate 'eventMessage contains "Previous shutdown cause"' --last 24h

kernel: (AppleSMC) Previous shutdown cause: 3

Code 3 is a "dirty" Shutdown, which can be caused by any user-initiated Reboot of the computer, or by forcing a hardware computer halt by holding down the power button for 5+ seconds.

标签: macosmacos-catalinarestart

解决方案


原因是以下 cronjob: 30 09 * * * sudo /sbin/shutdown -r now

查找用户的所有 cron 作业: crontab -l


推荐阅读