From b50886dda6ba6b3210cd737e49d56db139d5f37c Mon Sep 17 00:00:00 2001 From: Florian Hartwich Date: Sun, 23 Jul 2017 11:07:47 +0200 Subject: [PATCH] Change backup interval --- api/cron-job/{update-signatures.js => cron.js} | 6 +++--- api/routes/command.js | 2 +- api/server.js | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) rename api/cron-job/{update-signatures.js => cron.js} (93%) diff --git a/api/cron-job/update-signatures.js b/api/cron-job/cron.js similarity index 93% rename from api/cron-job/update-signatures.js rename to api/cron-job/cron.js index 3e4a5c4..1f93855 100644 --- a/api/cron-job/update-signatures.js +++ b/api/cron-job/cron.js @@ -1,4 +1,4 @@ -"use strict" +"use strict"; const cron = require('cron'); const async = require('async'); @@ -59,8 +59,8 @@ const createBackup = () => { // Execute daily @ 02:30 AM const cronJobSignature = cron.job('00 30 02 * * *', createAllSignatures); -// Execute daily @ 04:00 AM -const cronJobBackup = cron.job('00 00 04 * * *', createBackup); +// Execute daily @ 04:00 AM, on Mon, Thu and Sat +const cronJobBackup = cron.job('00 00 04 * * 0,3,5', createBackup); module.exports = { cronJobSignature: cronJobSignature, diff --git a/api/routes/command.js b/api/routes/command.js index 786e12f..5759d07 100644 --- a/api/routes/command.js +++ b/api/routes/command.js @@ -8,7 +8,7 @@ const logger = require('debug')('cc:command'); const codes = require('./http-codes'); const routerHandling = require('../middleware/router-handling'); -const createAllSignatures = require('../cron-job/update-signatures').createAllSignatures; +const createAllSignatures = require('../cron-job/cron').createAllSignatures; const createSignature = require('../signature-tool/signature-tool'); const command = express.Router(); diff --git a/api/server.js b/api/server.js index a8648f6..4ee2441 100644 --- a/api/server.js +++ b/api/server.js @@ -16,8 +16,8 @@ const restAPIchecks = require('./middleware/request-checks.js'); const errorResponseWare = require('./middleware/error-response'); const apiAuthenticationMiddleware = require('./middleware/auth-middleware'); const checkAdmin = require('./middleware/permission-check').checkAdmin; -const signatureCronJob = require('./cron-job/update-signatures').cronJobSignature; -const backupCronJob = require('./cron-job/update-signatures').cronJobBackup; +const signatureCronJob = require('./cron-job/cron').cronJobSignature; +const backupCronJob = require('./cron-job/cron').cronJobBackup; // router modules