Cronjob with web hooks.
npm install momo
|4||downloads in the last month|
|Version||0.0.130 last updated a year ago|
|Keywords||cron, cronjob, hook, web, webhook, schedule, worker|
Cronjob to web hooks.
Momo was designed to work as a worker (continuous process), and call it hooks when cron job should be executed.
Also Momo DOES NOT USE A DATABASE, it uses remote CSV file to fetch it hook cron list.
obs: All dates are forced to be on GMT.
All Configuration can be done through
server.js file in root directory. (This file is just a sample of a simple server)
option.cronURL- End point to fetch cronjob list. REQUIRED
options.cronFetchLoop- Time interval to Momo fetch
options.cronURLin seconds - Default value is:3600000 milliseconds. OPTIONAL
$ 'node server.js' OR 'foreman start'
Momo CronJob syntax is very near to the Unix cron syntax, BUT it'll not allow
? character ,words and special keywords. (the last 2, are on roadmap.)
* * * * * url_to_be_called ┬ ┬ ┬ ┬ ┬ │ │ │ │ │ │ │ │ │ │ │ │ │ │ └───── day of week (0 - 6) (0 is Sunday) │ │ │ └────────── month (1 - 12) │ │ └─────────────── day of month (1 - 31) │ └──────────────────── hour (0 - 23) └───────────────────────── min (0 - 59)
||Run one time a year, on midnight, January 1.|
||Run one time a month, on midnight, first day of month.|
||Run once a week, on midnight, on Sunday.|
||Run once a day, on midnight.|
||Run once a hour, on initial minute of it.|
*- Means deactivated OR if not alone, means anything.
1(or any number) - Only this number will match.
1,2,3- Any of these will match.
1-3- Range (same as
1,3-5- Range and individual (same as
All these commands can be combined with two stage command using the character
* * * * * http://example.com- Deactivated cronjob
@monthly http://example.com- Will run each month.
*/* * * * * http://example.com- Will run each 1 minute.
* */* * * * http://example.com- Will run each 1 minute.
2/* * * * * http://example.com- Will run every 2 minutes ,checking each minute.
6/2 * * * * http://example.com- Will run every 12 minutes in one hour.
6,2/2 * * * * http://example.com- Will run every 12 and 4 minutes.
2-4/* * * * * http://example.com- Will run every 2,3,4 minutes. (Will not call two times if have an collision, as this sample)
*/5 * * * * http://example.com- Will run on any minute divisible 5.
*/7,9 * * * * http://example.com- Will run each on minutes
18and any others divisible by 7 or 9 until 59, that is the minutes limit.
*/7-9 * * * * http://example.com- Will run each on minutes
9and any others divisible by 7,8, or 9 until 59, that is the minutes limit.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Added some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request