sailor-module-crontab
v1.0.1
Published
Schedule and run jobs like UNIX Crontab style
Downloads
3
Maintainers
Readme
Sailor Module Crontab
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