Skip to content
Snippets Groups Projects
Commit 295b9410 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

add deletion of logs

parent 795eb25b
No related branches found
No related tags found
No related merge requests found
...@@ -263,10 +263,11 @@ function deploy(){ ...@@ -263,10 +263,11 @@ function deploy(){
function logdelete(){ function logdelete(){
local sProfile=$1 local sProfile=$1
header "DELETE LOGS ${logdir}/${sProfile}__* ... keep $iKeep"
# order files by time # order files by time
typeset -i local _iFiles=$( ls -1t ${logdir}/${sProfile}__*.log | wc -l ) typeset -i local _iFiles=$( ls -1t ${logdir}/${sProfile}__*.log | wc -l )
typeset -i local _iStart=$iKeep+1 typeset -i local _iStart=$iKeep+1
header "DELETE LOGS ${logdir}/${sProfile}__* ... keep $iKeep"
if [ $_iFiles -gt $iKeep ]; then if [ $_iFiles -gt $iKeep ]; then
ls -1t ${logdir}/${sProfile}__*.log | sed -n "${_iStart},${_iFiles}p" | while read mylogfile ls -1t ${logdir}/${sProfile}__*.log | sed -n "${_iStart},${_iFiles}p" | while read mylogfile
do do
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment