Created
March 10, 2015 18:15
-
-
Save iaincollins/81c95f75744d01408fdc to your computer and use it in GitHub Desktop.
Cron for node
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Set up a scheduled job to fetch Bills with node-cron | |
| // https://github.com/ncb000gt/node-cron | |
| // | |
| // Just add this to your server.js (or app.js) file | |
| var CronJob = require('cron').CronJob; | |
| var job = new CronJob({ | |
| cronTime: '00 30 11 * * 1-5', | |
| onTick: function() { | |
| // Code goes here | |
| }, | |
| onComplete: function() { | |
| }, | |
| start: false, | |
| timeZone: "Europe/London" | |
| }); | |
| job.start(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment