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
-9
@@ -748,18 +748,16 @@ $ sudo tailscale set --auto-update=false
|
||||
|
||||
本步骤为可选操作,主要用于设置 TS 定时重启。
|
||||
|
||||
```bash
|
||||
## 编辑系统定时任务,编辑器选择 nano
|
||||
$ sudo crontab -e
|
||||
```
|
||||
|
||||
在配置文件末尾,增加以下内容。
|
||||
执行以下命令创建 Cronie 系统定时任务文件。
|
||||
|
||||
```bash
|
||||
## 定时任务配置项
|
||||
|
||||
30 10 * * * /usr/bin/systemctl restart tailscaled.service
|
||||
## 创建 Tailscale 定时重启任务
|
||||
$ sudo tee /etc/cron.d/tailscale-restart >/dev/null <<'EOF'
|
||||
30 10 * * * root /usr/bin/systemctl restart tailscaled.service
|
||||
EOF
|
||||
|
||||
## 设置定时任务文件权限
|
||||
$ sudo chmod 0644 /etc/cron.d/tailscale-restart
|
||||
```
|
||||
|
||||
至此,TS 服务器已配置完成。
|
||||
|
||||
Reference in New Issue
Block a user