From 5df8c3ae0c73ec739dcc1e1258878db5d1505dfa Mon Sep 17 00:00:00 2001 From: Nicolas Wavrant Date: Thu, 20 Oct 2016 17:49:12 +0200 Subject: [PATCH] resilient: export happen once a day, with a random date defined on 1st buildout run. This solution is better than adding a sleep in a crontab, because it will be a new date every day --- stack/resilient/buildout.cfg | 2 +- stack/resilient/pbsready-export.cfg.in | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/stack/resilient/buildout.cfg b/stack/resilient/buildout.cfg index 6a40ea0da..49b868f0d 100644 --- a/stack/resilient/buildout.cfg +++ b/stack/resilient/buildout.cfg @@ -59,7 +59,7 @@ mode = 0644 recipe = slapos.recipe.template url = ${:_profile_base_location_}/pbsready-export.cfg.in output = ${buildout:directory}/pbsready-export.cfg -md5sum = cb2537598981a1a4af0dea05cc6ac6bd +md5sum = 031fb7785cd5e99c2d794fa7e00e5190 mode = 0644 [template-pull-backup] diff --git a/stack/resilient/pbsready-export.cfg.in b/stack/resilient/pbsready-export.cfg.in index 41523a781..2155e402e 100644 --- a/stack/resilient/pbsready-export.cfg.in +++ b/stack/resilient/pbsready-export.cfg.in @@ -77,11 +77,9 @@ rendered = $${basedirectory:promises}/exporter-status recipe = slapos.cookbook:cron.d name = backup frequency = $${slap-parameter:resiliency-backup-periodicity} -# Sleep from 1 to 6 hours before backing up (disks/network IO optimization) -sleep-command = ${bash:location}/bin/bash -c "sleep $((RANDOM%(60*60*6)))" -command = ($${:sleep-command}; $${notifier-exporter:wrapper} --transaction-id `date +%s`) +once-a-day = true +command = $${notifier-exporter:wrapper} --transaction-id `date +%s` [slap-parameter] # In cron.d format (i.e things like */15 * * * * are accepted). -resiliency-backup-periodicity = 0 0 * * * - +resiliency-backup-periodicity = -- 2.25.1