神刀安全网

Schedule custom monitoring jobs and serve a socket.io connected monitoring website

cronus

Schedules custom monitoring jobs and servers a socket.io connected monitoring website.

Installation

$ git clone https://github.com/s-a/cronus.git; $ cd cronus; $ npm install;

Start

$ npm start; # or # $node server/app.js --port 3000 --folder ./jobs [--logFolder d:/logs];

Cron patterns

* * * * * * ┬ ┬ ┬ ┬ ┬ ┬ │ │ │ │ │ | │ │ │ │ │ └ 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) 

Detailed description : https://en.wikipedia.org/wiki/Cron

Example monitor job

"use strict";  var Job = function() {     this.cronPattern = "*/10 * * * * *";     this.name = "unicorn 10";     this.description = "You will see this message every 10 seconds";      return this; };   Job.prototype.test = function(controller) {     // your job code here.     return true; };  module.exports = Job;

Schedule custom monitoring jobs and serve a socket.io connected monitoring website

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Schedule custom monitoring jobs and serve a socket.io connected monitoring website

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址