From 3bc9fef5d890490bb4070ceedae87c815b6fd216 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Wed, 9 Feb 2022 09:16:09 +0100 Subject: [PATCH] add compression of logs --- backup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backup.sh b/backup.sh index 86f1ebd..a23d99c 100755 --- a/backup.sh +++ b/backup.sh @@ -197,6 +197,11 @@ EOFbackupinfo ls -l "$JOB_LOGFILE" echo + echo "INFO: $(date) - compress older logs" + echo find "${DIR_LOGS}" -name "*.log" -mtime +2 -print -exec gzip {} \; + find "${DIR_LOGS}" -name "*.log" -mtime +2 -print -exec gzip {} \; + echo + echo "INFO: $(date) - cleanup logs" echo find "${DIR_LOGS}" -mtime +28 -delete -print find "${DIR_LOGS}" -mtime +28 -delete -print -- GitLab