#!/usr/bin/bash

#Tate:2022.4.26
#Author:Yingjian
#function: 定时清理elasticsearch、logstash日志文件
#env

workdir=`cd $(dirname $0);pwd`

cat > $workdir/es_log_dir.txt << EOF
/data/elastic/logs
/usr/local/services/logstash/logs
EOF

while read line
do
find $line -type f -mtime +7 -exec rm -f {} \; 
done < $workdir/es_log_dir.txt
