清理前一天log日志shell

#!/bin/bash
logPathList=`cat <<STD
/data/logs/aiclass/backcms
/data/logs/aiclass/backcms1
/data/logs/aiclass/backop
/data/logs/aiclass/frontlistener
/data/logs/aiclass/frontlistener1
/data/logs/aiclass/gray
/data/logs/aiclass/stable1
/data/logs/aiclass/stable2
/data/logs/aiclass/webfe
STD
`
for logPath in $logPathList;do
if [ -d $logPath ];then
#-----清除目录下1天前的文件
cd $logPath && find . -type f -name '*.log.*' -mtime +0 2>/dev/null -exec rm -f {} \;
echo "cd $logPath && find . -type f -name '*.log.*' -mtime +0 2>/dev/null -exec rm -f {} \;"
fi
done

相关文章:

  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
猜你喜欢
  • 2021-12-20
  • 2021-07-23
  • 2021-06-23
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案