定时任务
npm install cron
var CronJob = require('cron').CronJob;
new CronJob('* * * * * *', function() {
console.log('You will see this message every second');
}, null, true, 'America/Los_Angeles');//后面这个是时区 可以不写 true表示立即执行 false就不是 则需要手动启动
--------------------------
var jobid = new CronJob('* * * * * *', function() {
console.log('You will see this message every second');
}, null, false)
jobid.start();//启动
jobid.stop();//终止
new CronJob('*/30 * * * * *', function() {....
new CronJob('* 10 * * * *', function() {....
new CronJob('0 10 * * * *', function() {....
new CronJob('10 05 14 * * *', function() {....
new CronJob('10 05 14-17 * * *', function() {....
new CronJob('10, 05 * * * *', function() {....