您的位置:首页 > 娱乐 > 八卦 > linux 定时任务

linux 定时任务

2025/2/24 0:50:45 来源:https://blog.csdn.net/weixin_39107270/article/details/141365112  浏览:    关键词:linux 定时任务

crontab -e
在里面添加 需要定时的任务
如:
58 23 * * * bash /home/log_daochu2.sh > /home//log.log 2>/home/log_error.log

SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root# For details see man 4 crontabs# Example of job definition:
# .---------------- minute (0 - 59)
# | .------------- hour (0 - 23)
# | | .---------- day of month (1 - 31)
# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...
# | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
# | | | | |
# * * * * * user-name command to be execute#每天 每隔5,10,15,20,30分钟执行一次定时任务
*/5 * * * * root /data0/myshell/collect5m.sh
#*/10 * * * * root /data0/myshell/collect10m.sh
#*/15 * * * * root /data0/myshell/collect15m.sh
#*/20 * * * * root /data0/myshell/collect20m.sh
#*/30 * * * * root /data0/myshell/collect30m.sh

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com