add random delay before execution

This commit is contained in:
Ludovic Cartier
2026-05-30 11:35:19 +02:00
parent 11cbea16ee
commit 1a4b5d3c54
2 changed files with 9 additions and 0 deletions
+8
View File
@@ -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 }}