wiki/运维/操作系统/Linux/笔记/26.任务计划.md
2025-01-02 10:46:09 +08:00

27 lines
514 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.

通过任务计划,可以让系统自动的按时间或周期性执行任务
## 1、一次性任务
```shell
at
常用选项:
-v显示版本信息
-t时间格式 MMDDhhmm
-l列出指定队列中等待运行的卓越
-d删除
-c查看具体作业
-f指定文件
```
```shell
at -f 1.sh now + 1 hour #在1小时后执行
at -f 1.sh 00:00 07.01.2024 #在2024年7月1日0点0分执行
```
2、周期性任务计划
```shell
crontab
常用选项
-l列出
-e编辑
-r移除所有
```