mirror of
https://gitee.com/callmer/pve_toss_notes.git
synced 2026-09-01 14:32:53 +08:00
更新 Cronie 定时任务配置方法
This commit is contained in:
+7
-12
@@ -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
|
||||
```
|
||||
|
||||
系统全局定时任务排期状态可使用以下命令进行查看。
|
||||
|
||||
Reference in New Issue
Block a user