Use flock locking in services

This commit is contained in:
Julian Rother 2023-09-16 19:39:55 +02:00
parent fb556ae0ad
commit 8e269821d3
No known key found for this signature in database
GPG key ID: 8F9B6AE9BAAE4899
4 changed files with 6 additions and 3 deletions

View file

@ -3,12 +3,15 @@ backups:
retention: retention:
enabled: true enabled: true
OnCalendar: "1:{{ 60|random(seed=(inventory_hostname + 'backups_jobs')) }}" OnCalendar: "1:{{ 60|random(seed=(inventory_hostname + 'backups_jobs')) }}"
lock_timeout: "{{ 6*60*60 }}"
run: run:
enabled: true enabled: true
OnCalendar: "3,11,19:{{ 60|random(seed=(inventory_hostname + 'backups_jobs')) }}" OnCalendar: "3,11,19:{{ 60|random(seed=(inventory_hostname + 'backups_jobs')) }}"
lock_timeout: "{{ 6*60*60 }}"
check: check:
enabled: true enabled: true
OnCalendar: "monday 5:{{ 60|random(seed=(inventory_hostname + 'backups_jobs')) }}" OnCalendar: "monday 5:{{ 60|random(seed=(inventory_hostname + 'backups_jobs')) }}"
lock_timeout: "{{ 6*60*60 }}"
export: export:
enabled: false enabled: false
OnCalendar: "{{ [21,22,23]|random(seed=(inventory_hostname + 'backups_export_h')) }}:{{ 60|random(seed=(inventory_hostname + 'backups_export_m')) }}" OnCalendar: "{{ [21,22,23]|random(seed=(inventory_hostname + 'backups_export_h')) }}:{{ 60|random(seed=(inventory_hostname + 'backups_export_m')) }}"

View file

@ -6,5 +6,5 @@ OnFailure=status-email-root@%n.service
Nice=19 Nice=19
IOSchedulingClass=idle IOSchedulingClass=idle
Type=simple Type=simple
ExecStart=/usr/local/bin/backup-check ExecStart=/bin/flock --timeout {{ backups.jobs.check.lock_timeout }} /run/backup-client.flock /usr/local/bin/backup-check

View file

@ -6,5 +6,5 @@ OnFailure=status-email-root@%n.service
Nice=19 Nice=19
IOSchedulingClass=idle IOSchedulingClass=idle
Type=simple Type=simple
ExecStart=/usr/local/bin/backup-retention ExecStart=/bin/flock --timeout {{ backups.jobs.retention.lock_timeout }} /run/backup-client.flock /usr/local/bin/backup-retention

View file

@ -6,5 +6,5 @@ OnFailure=status-email-root@%n.service
Nice=19 Nice=19
IOSchedulingClass=idle IOSchedulingClass=idle
Type=simple Type=simple
ExecStart=/usr/local/bin/backup-full ExecStart=/bin/flock --timeout {{ backups.jobs.run.lock_timeout }} /run/backup-client.flock /usr/local/bin/backup-full