更新 Cronie 定时任务配置方法

This commit is contained in:
CallMeR
2026-08-14 23:35:07 +08:00
parent 9beb1fba6a
commit 2fadc58a84
7 changed files with 70 additions and 80 deletions
+7 -12
View File
@@ -230,21 +230,16 @@ $ watch -d sensors
参数表示每月 `1``16` 号的 `02:30` 执行系统重启命令。
```bash
## 查看系统定时任务
$ crontab -l
## 编辑系统定时任务,编辑器选择 nano
$ crontab -e
```
在配置文件末尾,增加以下内容。
执行以下命令创建 Cronie 系统定时任务文件。
```bash
## 定时任务配置项
30 2 1,16 * * /usr/sbin/shutdown --reboot now
## 创建 PVE 定时重启任务
$ tee /etc/cron.d/pve-reboot >/dev/null <<'EOF'
30 2 1,16 * * root /usr/sbin/shutdown --reboot now
EOF
## 设置定时任务文件权限
$ chmod 0644 /etc/cron.d/pve-reboot
```
系统全局定时任务排期状态可使用以下命令进行查看。