From 9d603ce0fb43505c7cef0c71e94d2337685efdff Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Tue, 2 Nov 2021 15:40:29 +0100 Subject: [PATCH] add deletion of logs --- deploy_app.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deploy_app.sh b/deploy_app.sh index 206f651..380f823 100755 --- a/deploy_app.sh +++ b/deploy_app.sh @@ -265,10 +265,10 @@ function logdelete(){ # order files by time typeset -i local _iFiles=$( ls -1t ${logdir}/${sProfile}__.* | wc -l ) - + typeset -i local _iStart=$iKeep+1 header "DELETE LOGS ${logdir}/${sProfile}__* ... keep $iKeep" if [ $_iFiles -gt $iKeep ]; then - ls -1t ${logdir}/${sProfile}__.* | sed -n "${iKeep},${_iFiles}p" | while read mylogfile + ls -1t ${logdir}/${sProfile}__.* | sed -n "${_iStart},${_iFiles}p" | while read mylogfile do echo -n "deleting " ls -l "${mylogfile}" && rm -f "${mylogfile}" -- GitLab