shell | crontab 定时任务

crontab工具 linux下自带的定时任务执行器

常用命令:
crontab -l //显示用户的crontab文件的内容
crontab -e //编辑用户的crontab文件的内容
crontab -r //删除用户的crontab文件
注:在第一次使用crontab -e,会要求选择编辑器,我选择是vim.basic

修改编辑器,可以使用select-editor

使用语法:* * * * * $cmd
五个*依次代表 分钟 小时 几号 月份 星期,后面cmd是执行程序

for example:
0 14 * * 1-5 /bin/sh /data/test.sh
每个工作日的下午两点零分执行test.sh

参考:
https://www.cnblogs.com/xwdreamer/p/8980719.html
https://cloud.tencent.com/developer/article/1392291

原文地址:https://www.cnblogs.com/jiu0821/p/11194637.html