免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: Hendane
打印 上一主题 下一主题

crontab里能设置每秒执行一次么? [复制链接]

论坛徽章:
0
31 [报告]
发表于 2011-05-09 20:17 |只看该作者
cron 只能定到分钟。

论坛徽章:
0
32 [报告]
发表于 2011-05-09 22:51 |只看该作者
每秒执行一次cron,不耗资源么?

论坛徽章:
0
33 [报告]
发表于 2011-05-10 10:17 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
34 [报告]
发表于 2011-05-10 10:31 |只看该作者
计划不到一秒这种粒度

论坛徽章:
0
35 [报告]
发表于 2011-05-10 13:23 |只看该作者
60/1 * * * * command

论坛徽章:
0
36 [报告]
发表于 2011-05-10 14:20 |只看该作者
好像是这样一个道理

论坛徽章:
0
37 [报告]
发表于 2011-05-10 15:16 |只看该作者
提示: 作者被禁止或删除 内容自动屏蔽

论坛徽章:
0
38 [报告]
发表于 2011-05-11 09:39 |只看该作者
回复 1# Hendane


while :;do <commander>;sleep 1s;done

论坛徽章:
0
39 [报告]
发表于 2011-05-12 13:23 |只看该作者
60/1 * * * * command
hackmail 发表于 2011-05-10 13:23



    不对,看原文解释:

The forward slash (/) can be used to specify step values. The value of an integer can be skipped within a range by following the range with /<integer>. For example, 0-59/2 can be used to define every other minute in the minute field. Step values can also be used with an asterisk. For instance, the value */3 can be used in the month field to run the task every third month.


况且,分定位不能大于59这个数字。

论坛徽章:
0
40 [报告]
发表于 2011-05-12 13:55 |只看该作者
小心当机啊!!!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP