1.0.1 • Published 10 years ago

sailor-module-crontab v1.0.1

Weekly downloads
3
License
MIT
Repository
-
Last release
10 years ago

Sailor Module Crontab

Build Status Dependency status Dev Dependencies Status NPM Status

Schedule and run jobs like UNIX Crontab style

Install

npm install sailor-module-crontab

Usage

declare in config/crontab your jobs, like:

  • the key is the schedule job
  • the value is the function to exec

Example

Each minute write in terminal "Hello World"

module.exports.crontab =

  # eg: Print 'hello world' each minute
  '* * * * * *': -> console.log 'Hello World'

Additional

Remember cron format:

* * * * * *
| | | | | |
| | | | | +-- Year              (range: 1900-3000)
| | | | +---- Day of the Week   (range: 1-7, 1 standing for Monday)
| | | +------ Month of the Year (range: 1-12)
| | +-------- Day of the Month  (range: 1-31)
| +---------- Hour              (range: 0-23)
+------------ Minute            (range: 0-59)

Check cron documentation for more information and examples.

MIT © sailorjs