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
@@ -384,21 +384,16 @@ $ sudo systemctl status apt-daily-upgrade.timer
|
||||
|
||||
本步骤为可选操作,主要设置系统定时重启。
|
||||
|
||||
```bash
|
||||
## 查看系统定时任务
|
||||
$ sudo crontab -l
|
||||
|
||||
## 编辑系统定时任务,编辑器选择 nano
|
||||
$ sudo crontab -e
|
||||
```
|
||||
|
||||
在配置文件末尾,增加以下内容。
|
||||
执行以下命令创建 Cronie 系统定时任务文件。
|
||||
|
||||
```bash
|
||||
## 定时任务配置项
|
||||
|
||||
30 4 8,24 * * /usr/sbin/shutdown --reboot now
|
||||
## 创建 Guest OS 定时重启任务
|
||||
$ sudo tee /etc/cron.d/guest-os-reboot >/dev/null <<'EOF'
|
||||
30 4 8,24 * * root /usr/sbin/shutdown --reboot now
|
||||
EOF
|
||||
|
||||
## 设置定时任务文件权限
|
||||
$ sudo chmod 0644 /etc/cron.d/guest-os-reboot
|
||||
```
|
||||
|
||||
### 1.10.清理系统
|
||||
|
||||
Reference in New Issue
Block a user