免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: westering

[新手入门] crontab怎样每隔5分钟执行一次脚本? [复制链接]

论坛徽章:
0
发表于 2004-10-19 22:46 |显示全部楼层

crontab怎样每隔5分钟执行一次脚本?

To schedule /appl/program to run every five minutes,you can either use the crontab command or the at command.
crontab:
0,5,10,15,20,25,30,35,40,45,50,55 * * * *  /appl/program
Alternatively ,you can use the at command.For scheduling the /apl/program to run every five minutes,or some short intervals repeatedly,modify the /appl/program file by adding the at command as follows:

#!/usr/bin/ksh
at now + 5 minutes -f /appl/program >; /dev/null 2>;&1
print program executed at `date +%H:%M`>;>; /data/output

Start the first job with the command:
at now -f appl/program >; /dev/null 2>;&1
Understand???????????

论坛徽章:
0
发表于 2004-10-20 18:31 |显示全部楼层

crontab怎样每隔5分钟执行一次脚本?

原帖由 "banker" 发表:
实现是可以实现
但是楼主要偷懒



是啊,如果是每隔1分钟,怎么写那么多呢?

论坛徽章:
0
发表于 2004-10-21 09:54 |显示全部楼层

crontab怎样每隔5分钟执行一次脚本?

crontab  是定时器,是在那个时间点执行,不是每隔多长时间执行。
如果是每隔多长时间,写shell好了。

论坛徽章:
0
发表于 2004-10-21 22:24 |显示全部楼层

crontab怎样每隔5分钟执行一次脚本?

原帖由 "westering" 发表:



是啊,如果是每隔1分钟,怎么写那么多呢?


要是1分钟,就可以写  0-59 了,,用范围表示

论坛徽章:
0
发表于 2004-10-22 11:54 |显示全部楼层

crontab怎样每隔5分钟执行一次脚本?

原帖由 "tomorrowmine" 发表:


要是1分钟,就可以写  0-59 了,,用范围表示

use * * * * * for every minutes

论坛徽章:
0
发表于 2012-10-27 09:53 |显示全部楼层
AIX不支持“ */5 * * * * ”格式,AIX环境下crontab每隔5分钟执行一次,可以这样写: 0-59/5 * * * *
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP