作者:9asd8fy | 来源:互联网 | 2023-06-12 22:01
定时任务为5域模式分钟、小时、日、月、周crontab-l查看当前的任务列表,其实就是crontab文件的内容crontab-e打开定时任务列表文件,进行编辑(可以使用#进行添加注
定时任务为 5域模式 分钟、小时、日、月、周
crontab -l 查看当前的任务列表,其实就是crontab文件的内容
![](https://img2.php1.cn/3cdc5/3beb/9f3/469f6201cd962ea0.png)
crontab -e 打开定时任务列表文件,进行编辑(可以使用# 进行添加注释)
![](https://img2.php1.cn/3cdc5/3beb/9f3/fba7c68a98aebfd8.png)
下面是最常用的命令:
[root@localhost ~]# crontab [选项]
选项:
-e: 编辑crontab定时任务
-l: 查询crontab任务
-r: 删除当前用户所有的crontab任务 (慎用)
![](https://img2.php1.cn/3cdc5/3beb/9f3/785c3fb758c59017.png)