From 315012367177df50676fe80303ad97607ba3e5b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=2ES?= Date: Mon, 8 Apr 2019 10:38:24 +0200 Subject: [PATCH] pick_server: Cast date to decimal Otherwise, days <10 will be octal, because starting with a 0. --- zzz_evobackup | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zzz_evobackup b/zzz_evobackup index 999bc80..a06aaca 100755 --- a/zzz_evobackup +++ b/zzz_evobackup @@ -80,7 +80,8 @@ pick_server() { salt=$(hostname | cksum | cut -d' ' -f1) # Pick an integer between 0 and the length of the SERVERS list # It changes each day - item=$(( ($(date +%d) + salt + increment) % list_length )) + today=10#$(date +%d) + item=$(( ($today + salt + increment) % list_length )) # cut starts counting fields at 1, not 0. field=$(( item + 1 )) -- 2.39.2