Ajout de l'option force_calendar pour choisir l'heure des backups restic

mise_a_niveau
korenstin 2025-04-19 15:38:15 +02:00
parent 6fc7c0a2e0
commit ca5ef757f8
3 changed files with 8 additions and 0 deletions

View File

@ -48,12 +48,14 @@ loc_restic:
- /etc
- /var
pool:
force_calendar: "5:00"
to_exclude:
- "*.pyc"
- "\\#*\\#"
- "*~"
to_backup:
- /pool/home
- /pool/mail
retention:
- [--keep-daily, 4]
- [--keep-weekly, 4]

View File

@ -9,6 +9,8 @@ la [documentation](gitlab.crans.org/nounous/documentation).
glob_restic: (ou loc_restic dans host_vars)
config:
<nom>:
force_calendar: si n'existe pas, utilise une heure aléatoire, si existe
force une heure.
to_exclude: chemins à ne pas backuper
to_backup: chemins à backuper
retention: règles de conservations

View File

@ -3,7 +3,11 @@
[Unit]
[Timer]
{% if restic.config[item.0].force_calendar is defined %}
OnCalendar={{ restic.config[item.0].force_calendar }}
{% else %}
OnCalendar={{ 24 | random(seed=inventory_hostname+item.0) }}:{{ 60 | random(seed=inventory_hostname+item.0) }}
{% endif %}
Persistent=true
[Install]