Commit 315cf333 authored by Nicolas Wavrant's avatar Nicolas Wavrant

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
parent 01870c29
......@@ -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]
......
......@@ -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 =
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment