Commit 5df8c3ae 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 92c63f96
...@@ -59,7 +59,7 @@ mode = 0644 ...@@ -59,7 +59,7 @@ mode = 0644
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/pbsready-export.cfg.in url = ${:_profile_base_location_}/pbsready-export.cfg.in
output = ${buildout:directory}/pbsready-export.cfg output = ${buildout:directory}/pbsready-export.cfg
md5sum = cb2537598981a1a4af0dea05cc6ac6bd md5sum = 031fb7785cd5e99c2d794fa7e00e5190
mode = 0644 mode = 0644
[template-pull-backup] [template-pull-backup]
......
...@@ -77,11 +77,9 @@ rendered = $${basedirectory:promises}/exporter-status ...@@ -77,11 +77,9 @@ rendered = $${basedirectory:promises}/exporter-status
recipe = slapos.cookbook:cron.d recipe = slapos.cookbook:cron.d
name = backup name = backup
frequency = $${slap-parameter:resiliency-backup-periodicity} frequency = $${slap-parameter:resiliency-backup-periodicity}
# Sleep from 1 to 6 hours before backing up (disks/network IO optimization) once-a-day = true
sleep-command = ${bash:location}/bin/bash -c "sleep $((RANDOM%(60*60*6)))" command = $${notifier-exporter:wrapper} --transaction-id `date +%s`
command = ($${:sleep-command}; $${notifier-exporter:wrapper} --transaction-id `date +%s`)
[slap-parameter] [slap-parameter]
# In cron.d format (i.e things like */15 * * * * are accepted). # 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