This commit is contained in:
teasiu
2022-09-26 17:23:25 +08:00
parent 0200b76688
commit 2e3303eca9

View File

@@ -3,4 +3,31 @@ sidebar_position: 8
---
# 定时任务
优秀的Linux crontab任务管理器
## 使用基础
- 编辑任务管理器
```bash
crontab -e
```
- 浏览任务管理器
```bash
crontab -l
```
## 添加任务
- 实例1每1分钟执行一次myCommand
```bash
* * * * * myCommand
```
- 实例2每晚的21:30重启smb
```bash
30 21 * * * systemctl restart smbd
```
- 实例3每一小时重启smb
```bash
0 */1 * * * systemctl restart smbd
```