macos - 如何获取 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.
解决方案
原因是以下 cronjob:
30 09 * * * sudo /sbin/shutdown -r now
查找用户的所有 cron 作业:
crontab -l
推荐阅读
- android - 如何在辅助/外部屏幕上运行 qt android 应用程序
- php - Laravel - 带有值标签的测试编辑表单
- python - 在已经存在的嵌入中添加用户的消息输入
- c# - 无法让运算符使用小数和双精度,但我需要它。有什么方法可以在不重做我的整个代码的情况下解决这个问题?
- sas - SAS 回归结果输出到一张表格中的 excel
- ios - Swift Compiler Error: use of undeclared type with framework
- mongodb - mongodb - 嵌入式字段与嵌入式文档索引
- augmented-reality - ARKit2 视频资产流
- python-3.x - 如何从python中的csv文件中读取一列数据,我应该如何计算平均值然后找出最大值?
- c++ - 对 `PPM::PPM() 的未定义引用找不到我收到此错误的原因