linux定时任务crontab

发布: 2019-05-06 12:22:25标签: linux

定时任务编辑

01# 会使用vim打开编辑页面
02crontab -e
03# 查看用户定时任务
04crontab -l
05# 查看定时任务日志
06tail -f /var/log/cron
复制代码
01# 打开编辑页面
02# .---------------- minute (0 - 59)
03# | .------------- hour (0 - 23)
04# | | .---------- day of month (1 - 31)
05# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
06# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
07# | | | | |
08# * * * * * command to be executed
复制代码

例子

01# 每分钟刷新接口数据
020 7 * * * curl "https://www.luzhongkuan.cn/api/todayEnglish" >> /root/a.log 2>&1 &
复制代码