cd /logs
hisDate=`date -d"-1 week" +%Y%m%d`
for currentD in `find /logs/ -type d`
do
logDir=`echo $currentD|cut -d"/" -f4`
logDate=${logDir}
if [ ${hisDate} -gt 0 -a ${logDate} -gt 0 ] 2>/dev/null ;then
_intervalGap=$(( ($(date +%s -d"${hisDate}")-$(date +%s -d"${logDate}"))/86400 ))
if [ ${_intervalGap} -gt 0 ] ;then
echo $currentD
fi
扫描二维码关注公众号,回复:
9734870 查看本文章
fi
done