You've already forked proxmox-backup
add random delay before execution
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
---
|
||||
pbs_repo_key: "https://enterprise.proxmox.com/debian/proxmox-release-{{ ansible_distribution_release }}.gpg"
|
||||
pbs_random_delay: 900 # 15 minutes in seconds
|
||||
pbs_repo_no_subscription: "deb [signed-by=/etc/apt/trusted.gpg.d/proxmox-release-{{ ansible_distribution_release }}.gpg] http://download.proxmox.com/debian/pbs-client {{ ansible_distribution_release }} main"
|
||||
|
||||
backup_mysql_host: ""
|
||||
|
||||
@@ -3,6 +3,14 @@
|
||||
|
||||
[ ! -f /usr/bin/proxmox-backup-client ] && echo "proxmox-backup-client is not installed: exiting." && exit 1
|
||||
|
||||
{% if pbs_random_delay | int > 0 %}
|
||||
## random delay to avoid PBS connection flood ##
|
||||
delay=$((RANDOM % {{ pbs_random_delay }}))
|
||||
echo "Sleeping ${delay}s before starting backup (max delay: {{ pbs_random_delay }}s)..."
|
||||
sleep $delay
|
||||
## end of random delay ##
|
||||
|
||||
{% endif %}
|
||||
today=`date +%Y-%m-%d`
|
||||
backup_dir={{ backup_dir }}
|
||||
backup_local_retention={{ backup_local_retention }}
|
||||
|
||||
Reference in New Issue
Block a user