diff --git a/get-all-logs.sh b/get-all-logs.sh index a1ff07c..3359044 100644 --- a/get-all-logs.sh +++ b/get-all-logs.sh @@ -1,5 +1,7 @@ #!/bin/bash +# about script +version="17/06/23" PRMT="[$(whoami)@$(hostname -s) ]" @@ -24,7 +26,7 @@ function askYesNo { } _logs3days(){ - files3d=($(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*")); + files3d=($(find . -maxdepth 1 ! -iname "*log*.sh" -mtime -3 -iname "*logs*" -o -mtime -3 -iname "*vm_lic*" -o -mtime -3 -iname "*vm_node*" -o -mtime -3 -iname "*short-logs*")); if [[ ${#files3d[@]} >0 ]];then echo -e "\n*********************** platform's logs for last 3 days *************************\n"; for item3d in ${files3d[*]} @@ -39,7 +41,7 @@ _logs3days(){ } _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*")); + 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 echo "founded platform logs older than last 3 days"; @@ -207,8 +209,6 @@ node_collect() { } _help(){ -# about script -version="15/04/23" echo -e "*********************************************************************************"; echo -e "*\t\t\tISPsystem technical support\t\t\t\t*"; echo -e "*\t\t\tLog's script ver.: $version\t\t\t\t*"; @@ -221,6 +221,8 @@ echo -e "\t-lic or 3\t\t\t\t logs about license"; echo -e "\t-node or 4 \t node's logs\n"; _logs3days; +_remove_logs; + echo -e "\t\t\t\t *** MENU ***\t\t\t\t\n"; PS3='Please enter your choice(enter number): ' # interactive menu