borg-backup: space out cron jobs evenly
To avoid the backup jobs running over the top of each other, space the cron jobs out evenly through the day for each server. Change-Id: I07a096ee130e61e9efc89887d627da8ef829854a
This commit is contained in:
parent
b05a98440a
commit
93b4c9ed1f
@ -58,9 +58,13 @@
|
||||
name: "Run borg backup to {{ item }}"
|
||||
job: "/usr/local/bin/borg-backup {{ item }} 2>> /var/log/borg-backup-{{ item }}.log"
|
||||
user: root
|
||||
hour: '5'
|
||||
# This should space out the backups so they run in a round-robbin
|
||||
# evenly through the day to each of the different backup servers
|
||||
hour: '{{ ((5 + ((24 / ansible_loop.length) * ansible_loop.index0 )) % 24) | int}}'
|
||||
minute: '{{ 59|random(seed=item) }}'
|
||||
with_inventory_hostnames: borg-backup-server
|
||||
loop_control:
|
||||
extended: yes
|
||||
|
||||
- name: Install logrotate rules
|
||||
include_role:
|
||||
|
Loading…
Reference in New Issue
Block a user