fix check and removing logs

This commit is contained in:
Сергей Гудаев 2023-06-17 01:49:09 +08:00
parent 1b230192ed
commit c9f348b0ec

View File

@ -44,7 +44,7 @@ _remove_logs (){
files=($(find . -maxdepth 1 -mtime +3 -iname "*logs*" -o -mtime +3 -iname "*vm_lic*" -o -mtime +3 -iname "*vm_node*" -o -mtime +3 -iname "*short-logs*" ! -iname "get*log*.sh")); files=($(find . -maxdepth 1 -mtime +3 -iname "*logs*" -o -mtime +3 -iname "*vm_lic*" -o -mtime +3 -iname "*vm_node*" -o -mtime +3 -iname "*short-logs*" ! -iname "get*log*.sh"));
if [[ ${#files[@]} >0 ]];then if [[ ${#files[@]} >0 ]];then
echo "\n************* Founded platform logs older than last 3 days **********************\n"; echo -e "\n************* Founded platform logs older than last 3 days **********************\n";
for item in ${files[*]} for item in ${files[*]}
do do
# printf " %s\n" $item # printf " %s\n" $item
@ -57,7 +57,7 @@ _remove_logs (){
if [ "$DOIT" = true ]; then if [ "$DOIT" = true ]; then
for item in ${files[*]} for item in ${files[*]}
do do
printf "********* deleting %s ************\n" $item; printf "\n>>>>> Deleting %s \n" $item;
rm -rfv $item; rm -rfv $item;
done done
echo "Platform logs older than 3 days have been deleted!"; echo "Platform logs older than 3 days have been deleted!";