#!/bin/sh for in. /* do if test-d $p then touch $p ". Ok" if test-f $p "/busi.xml" then echo "Delete ${p}/ Busi.xml " rm $p"/busi.xml " fi for Z in $ (Find $p-name" *.zip ") do echo" Delete ${z} ... " C16/>rm $z done fidone
#!/bin/SH while true DoRead-P"Please input or restart ServerName:"cmdif[" Look"="$cmd" ] ThenPS-ef |grepjava |awk 'functionAdd (A, St, Lee, VV, SV, Slen, SUBSS, Arrs) {match (A,/dweblogic.name= ([^]+)/); VV=substr (A, rstart,rlength); Split(VV, Arrs,"="); if(arrs[2]) {print arrs[2]; } {Add ($0);}'ElseStrres=`Echo$cmd |awk-F' ' '{print $;}'' Strcmd=`Echo$cmd |awk-F' ' '{print $;}'` if[$STRCMD ="Restart" ] ThenStrpid=0 Echo`PS-ef |grepjava |awk ' functionAddr (A, St, Lee, VV, SV, Slen, SUBSS, Arrs) {Lee="dweblogic.name="Stif(Index (A, Lee) >0) {print A; }} {addr ($0, strres);}'strres= "$strRes" | awk-f' ' '{print $2}'' > Pid.temp # Echo`Catpid.temp ' Strpid=$(Catpid.temp)Kill-9$strPid SD=$(`Echo Find~/user_projects-name $strRes ') CD $SDRM-rf./tmp CD :/.. /binls-L Read-P"Please input start sh name:"Shcus./$shcus". SH" Echo$shcus"Is start ..."CD~/Nohuplogls-L Read-P"Please input Rizhi name:"ShcusrizhiTail-200F $shcusrizhi". Log" fi# Endif[$STRCMD ="Restart" ] fi Done
Script 1, in the sibling directory, creates an OK file based on the folder.
Script 2, kill the process, start the service.
Linux Shell Demo