Files
doc/docs/tutorial-extras/8-crontab.md
2022-09-26 17:40:02 +08:00

38 lines
531 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
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
```
## 学习教材
[](https://www.runoob.com/w3cnote/linux-crontab-tasks.html)