文章目录
- crontab 服务管理
- crontab -e :编辑crontab 定时任务
- crontab -l 查看crontab 任务
- crontab -r 删除当前用户所有的crontab 任务
crontab 服务管理
systemctl status crond
该系统进程是开机自启动,并且被打开了,可以使用。
crontab -e :编辑crontab 定时任务
进入crontab 编辑界面。会打开vim 编辑你的工作。
-
-
-
-
- 执行的任务
每隔一分钟向txt文件增加一行hello,world
- 执行的任务
-
-
-
*/1 * * * * echo "hello world">>/root/test.txt
查看当前目录下有了test.txt
ls
监控test.txt文件变化
tail -f test.txt
crontab -l 查看crontab 任务
crontab -l
crontab -r 删除当前用户所有的crontab 任务
crontab -r
crontab -l
no crontab for root