crontab每秒执行任务

linux 2020-09-10 浏览(332 评论(0

图片描述

crontab时间格式:

分 时 日 月 周
第1列表示分钟1~59 每分钟用或者 */1表示,/n表示每n分钟,例如*/8就是每8分钟的意思,下面也是类推
第2列表示小时1~23(0表示0点)
第3列表示日期1~31
第4列表示月份1~12
第5列标识号星期0~6(0表示星期天)
  • 1、每秒执行一次
*/1 * * * * /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 1 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 2 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 3 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 4 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 5 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 6 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 7 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 8 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 9 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 10 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 11 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 12 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 13 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 14 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 15 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 16 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 17 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 18 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 19 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 20 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 21 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 22 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 23 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 24 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 25 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 26 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 27 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 28 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 29 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 30 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 31 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 32 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 33 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 34 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 35 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 36 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 37 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 38 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 39 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 40 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 40 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 40 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 40 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 41 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 42 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 43 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 44 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 45 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 46 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 47 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 48 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 49 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 50 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 51 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 52 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 53 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index 
*/1 * * * * sleep 54 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 55 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 56 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 57 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 58 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 59 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
  • 2、每隔30秒执行一次
*/1 * * * * /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index
*/1 * * * * sleep 30 && /user/local/php/bin/php /home/wwwroot/yii(项目根目录) test/index

打赏

如果此文对你有所帮助,请随意打赏鼓励作者^_^

黄信强博客