首页 > 其他 > 详细

node-schedule定时任务

时间:2016-05-07 16:37:37      阅读:90      评论:0      收藏:0      [点我收藏+]

https://github.com/node-schedule/node-schedule

npm install node-schedule

*    *    *    *    *    *
┬    ┬    ┬    ┬    ┬    ┬
│    │    │    │    │    |
│    │    │    │    │    └ day of week (0 - 7) (0 or 7 is Sun)
│    │    │    │    └───── month (1 - 12)
│    │    │    └────────── day of month (1 - 31)
│    │    └─────────────── hour (0 - 23)
│    └──────────────────── minute (0 - 59)
└───────────────────────── second (0 - 59, OPTIONAL)


var schedule = require(‘node-schedule‘);

var j = schedule.scheduleJob(‘42 * * * *‘, function(){
  console.log(‘The answer to life, the universe, and everything!‘);
});

j.cancel();

node-schedule定时任务

原文:http://www.cnblogs.com/w-jinfeng/p/5468394.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!