Use flock locking in services
This commit is contained in:
parent
fb556ae0ad
commit
8e269821d3
4 changed files with 6 additions and 3 deletions
|
|
@ -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')) }}"
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue