fix searching logs

This commit is contained in:
Сергей Гудаев 2023-04-27 17:46:03 +08:00
parent 68b5d2993c
commit ad1965e20c

View File

@ -24,7 +24,6 @@ function askYesNo {
} }
_logs3days(){ _logs3days(){
# files3d=($(find ~/ -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 -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 -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 if [[ ${#files3d[@]} >0 ]];then
echo -e "\n*********************** platform's logs for last 3 days *************************\n"; echo -e "\n*********************** platform's logs for last 3 days *************************\n";
@ -34,7 +33,7 @@ _logs3days(){
du -sh $item3d du -sh $item3d
done done
echo -e "\n*********************************************************************************\n"; echo -e "\n*********************************************************************************\n";
else elif [[ ${#files3d[@]} == 0 ]];then
echo -e "\n************************** Logs are not founded:( You Can Do It! ****************\n"; echo -e "\n************************** Logs are not founded:( You Can Do It! ****************\n";
fi; fi;
} }
@ -220,7 +219,7 @@ echo -e "\t-short-logs or 2\t\t\t logs for only last 7 days";
echo -e "\t-lic or 3\t\t\t\t logs about license"; echo -e "\t-lic or 3\t\t\t\t logs about license";
echo -e "\t-node or 4 <IP-address> <SSH-port>\t node's logs\n"; echo -e "\t-node or 4 <IP-address> <SSH-port>\t node's logs\n";
_logs3days; #_logs3days;
echo -e "\t\t\t\t *** MENU ***\t\t\t\t\n"; echo -e "\t\t\t\t *** MENU ***\t\t\t\t\n";
PS3='Please enter your choice(enter number): ' PS3='Please enter your choice(enter number): '
# interactive menu # interactive menu