Skip to content

Instantly share code, notes, and snippets.

@iaincollins
Created March 10, 2015 18:15
Show Gist options
  • Save iaincollins/81c95f75744d01408fdc to your computer and use it in GitHub Desktop.
Save iaincollins/81c95f75744d01408fdc to your computer and use it in GitHub Desktop.
Cron for node
// 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