[UPDATE] - script & log
This commit is contained in:
parent
c3a57a8a6a
commit
5fc6a2cc3b
@ -2,5 +2,6 @@
|
|||||||
DirFct=$(realpath $(dirname $0))/$(echo $(basename $0)| sed 's/.sh/.d/g')/
|
DirFct=$(realpath $(dirname $0))/$(echo $(basename $0)| sed 's/.sh/.d/g')/
|
||||||
DirCheck=$(realpath $(dirname $0))/Check
|
DirCheck=$(realpath $(dirname $0))/Check
|
||||||
DirApply=$(realpath $(dirname $0))/Apply
|
DirApply=$(realpath $(dirname $0))/Apply
|
||||||
Debug='-x'
|
#Debug='-x'
|
||||||
LogDir=/var/log/$(echo $(basename $0) |sed 's/.sh//g')/$(date +%H%m%d%H%M%S)/
|
Debug=""
|
||||||
|
LogDir=/var/log/$(echo $(basename $0) |sed 's/.sh//g')/$(date +%H%m%d%H%M%S)
|
||||||
|
|||||||
@ -19,7 +19,7 @@ function LogTest() {
|
|||||||
echo -e "\n### ${2} - [RESULT] - ${3} : FAILED"
|
echo -e "\n### ${2} - [RESULT] - ${3} : FAILED"
|
||||||
else
|
else
|
||||||
echo -e "\n### ${2} - [RESULT] - ${3} : SUCESS"
|
echo -e "\n### ${2} - [RESULT] - ${3} : SUCESS"
|
||||||
fi | tee -a ${LogDir}/${3}.log
|
fi | tee -a ${RealLogDir}/${3}.log
|
||||||
}
|
}
|
||||||
|
|
||||||
function GetArg(){
|
function GetArg(){
|
||||||
|
|||||||
@ -30,14 +30,15 @@ source ${DirFct}/function_${Action}
|
|||||||
|
|
||||||
[[ $Level -eq 2 ]] && RealLevel=\* || RealLevel=1
|
[[ $Level -eq 2 ]] && RealLevel=\* || RealLevel=1
|
||||||
DirAction=$(realpath $(dirname $0))/${Action}/${Type}/${RealLevel}
|
DirAction=$(realpath $(dirname $0))/${Action}/${Type}/${RealLevel}
|
||||||
|
RealLogDir=$(dirname ${LogDir})/${Action}_$(basename ${LogDir})
|
||||||
|
|
||||||
[[ ! -d ${LogDir} ]] && mkdir -p ${LogDir} || true
|
[[ ! -d ${RealLogDir} ]] && mkdir -p ${RealLogDir} || true
|
||||||
|
|
||||||
for File in $(find ${DirAction} -type f -name run.sh| sort -n)
|
for File in $(find ${DirAction} -type f -name run.sh| sort -n)
|
||||||
do
|
do
|
||||||
cd $(dirname ${File})
|
cd $(dirname ${File})
|
||||||
Test=$(basename $(dirname ${File}))
|
Test=$(basename $(dirname ${File}))
|
||||||
export CptErr=0
|
export CptErr=0
|
||||||
bash ${Debug} ./run.sh &> ${LogDir}/${Test}.log
|
bash ${Debug} ./run.sh &> ${RealLogDir}/${Test}.log
|
||||||
LogTest ${?} ${Action} ${Test}
|
LogTest ${?} ${Action} ${Test}
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user