Skip to content

Instantly share code, notes, and snippets.

@theouerd
Created November 25, 2019 20:43
Show Gist options
  • Save theouerd/ea801d8cf0eab49033674b58c4bd2085 to your computer and use it in GitHub Desktop.
Save theouerd/ea801d8cf0eab49033674b58c4bd2085 to your computer and use it in GitHub Desktop.
a configuration file that specifies shell commands to run periodically on a given schedule.
const CronJob = require('cron').CronJob;
const Cron = require('./backup.js');
// AutoBackUp every week (at 00:00 on Sunday)
new CronJob(
'0 0 * * 0',
function() {
Cron.dbAutoBackUp();
},
null,
true,
'America/New_York'
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment