From 795eb25ba87d21476ff4f47dd0beb2fcac8d41ec Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@iml.unibe.ch> Date: Tue, 2 Nov 2021 15:52:51 +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 380f823..e0eff40 100755 --- a/deploy_app.sh +++ b/deploy_app.sh @@ -264,11 +264,11 @@ function logdelete(){ local sProfile=$1 # order files by time - typeset -i local _iFiles=$( ls -1t ${logdir}/${sProfile}__.* | wc -l ) + typeset -i local _iFiles=$( ls -1t ${logdir}/${sProfile}__*.log | 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 "${_iStart},${_iFiles}p" | while read mylogfile + ls -1t ${logdir}/${sProfile}__*.log | sed -n "${_iStart},${_iFiles}p" | while read mylogfile do echo -n "deleting " ls -l "${mylogfile}" && rm -f "${mylogfile}" -- GitLab