From 2e3303eca9f83c78504831007962707ee2e9d923 Mon Sep 17 00:00:00 2001 From: teasiu Date: Mon, 26 Sep 2022 17:23:25 +0800 Subject: [PATCH] update --- docs/tutorial-extras/8-crontab.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/docs/tutorial-extras/8-crontab.md b/docs/tutorial-extras/8-crontab.md index a10b40c..b2d4baa 100644 --- a/docs/tutorial-extras/8-crontab.md +++ b/docs/tutorial-extras/8-crontab.md @@ -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 +```