linux 上在指定时间段内每隔多少分钟自动执行任务计划crontab

2020-10-19 10:17:27 浏览数 (1)

先看代码

代码语言:javascript复制
#/bin/sh
datename=$(date  %Y%m%d-%H%M%S)
echo $datename >> /tmp/logtest.txt
*/2 19,20 * * * /bin/sh /root/1.sh

在每天晚上2点到19和20点每2分钟执行一次

代码语言:javascript复制
[root@dpm ~]# cat /tmp/logtest.txt
20191112-180001
20191112-180201
20191112-180401
20191112-180601
20191112-180801
20191112-181001
20191112-181201
20191112-181401
20191112-181601
20191112-181801
20191112-182001
20191112-182201
20191112-182401
20191112-182601
20191112-182801
20191112-183001
20191112-183201
20191112-183401
20191112-183601
20191112-183801
20191112-184002
20191112-184201
20191112-184401
20191112-184601
20191112-184801
20191112-185001
20191112-185201
20191112-185401
20191112-185601
20191112-185801
20191112-190001
20191112-190201
20191112-190401
20191112-190601
20191112-190801
20191112-191001
20191112-191201
20191112-191401
20191112-191601
20191112-191801
20191112-192001
20191112-192201
20191112-192401
20191112-192601
20191112-192802
20191112-193001
20191112-193201
20191112-193401
20191112-193601
20191112-193801
20191112-194001
20191112-194201
20191112-194401
20191112-194601
20191112-194801
20191112-195001
20191112-195201
20191112-195401
20191112-195601
20191112-195801

总结

以上所述是小编给大家介绍的linux 上在指定时间段内每隔多少分钟自动执行任务计划crontab,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对ZaLou.Cn网站的支持! 如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

0 人点赞