From 330ff7cd805c1b523f4266056198ac2564cafb3f Mon Sep 17 00:00:00 2001 From: Mart124 <37041094+Mart124@users.noreply.github.com> Date: Mon, 4 May 2020 13:48:16 +0200 Subject: [PATCH] Fix sleep calculation (#719) * Fix sleep calculation * Fix sleep calculation --- util/MsSql/backup-db.sh | 2 +- util/Nginx/logrotate.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/util/MsSql/backup-db.sh b/util/MsSql/backup-db.sh index 0516c29b3..d7234d66b 100644 --- a/util/MsSql/backup-db.sh +++ b/util/MsSql/backup-db.sh @@ -3,7 +3,7 @@ while true do # Sleep until next day - [ "$1" = "loop" ] && sleep $((24 * 3600 - (`date +%H` * 3600 + `date +%M` * 60 + `date +%S`))) + [ "$1" = "loop" ] && sleep $((24 * 3600 - (`date +%_H` * 3600 + `date +%_M` * 60 + `date +%_S`))) # Backup timestamp export now=$(date +%Y%m%d_%H%M%S) diff --git a/util/Nginx/logrotate.sh b/util/Nginx/logrotate.sh index 49976614a..d86c79c5d 100644 --- a/util/Nginx/logrotate.sh +++ b/util/Nginx/logrotate.sh @@ -2,7 +2,7 @@ while true do - [ "$1" = "loop" ] && sleep $((24 * 3600 - (`date +%H` * 3600 + `date +%M` * 60 + `date +%S`))) + [ "$1" = "loop" ] && sleep $((24 * 3600 - (`date +%_H` * 3600 + `date +%_M` * 60 + `date +%_S`))) ts=$(date +%Y%m%d_%H%M%S) mv /var/log/nginx/access.log /var/log/nginx/access.$ts.log mv /var/log/nginx/error.log /var/log/nginx/error.$ts.log