脚本-查找日志
# 查找具体/log文件夹下日期为2018-10-28号所有的文件
#!/bin/bash
function read_dir(){
dtime="/"$2"/p"
for file in `ls $1 --full-time|sed -n $dtime|awk '{print $9}' `
do
if [ -d $1"/"$file ]
then
read_dir $1"/"$file
else
fileName=$1"/"$file
echo $file
echo $fileName
readlog $fileName
fi
done
}
function readlog(){
grep --color=auto -C 10 'update t_user_space' $1|grep --color=auto -C 3 '77444'
}
dd=2018-10-28
ap=/log
read_dir $ap $dd