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

add deletion of logs

parent 9d603ce0
No related branches found
No related tags found
No related merge requests found
......@@ -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}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment