Commit 94e8d370 authored by Nicolas Wavrant's avatar Nicolas Wavrant

resilient: prevents all resilient instances to start backing up at the same time

parent 5551b0cf
......@@ -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 = c819c0711d58e952f16b93d96654139c
md5sum = 2f08cfdc1955bad5bd06ba79ee5a5780
mode = 0644
[template-pull-backup]
......
......@@ -58,7 +58,9 @@ pidfile = $${resilient-directory:pid}/$${:name}.pid
recipe = slapos.cookbook:cron.d
name = backup
frequency = $${slap-parameter:resiliency-backup-periodicity}
command = $${notifier-exporter:wrapper} --transaction-id `date +%s`
# 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`)
[slap-parameter]
# In cron.d format (i.e things like */15 * * * * are accepted).
......
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