#! /bin/sh
date=$(/bin/date -d -1day +%Y-%m-%d)
tomcat_date=$(/bin/date -d -1day +%Y%m%d)
#tomcat日志
tomcat_logs_path_a="PATH"
tomcat_logs_path_b="PATH"
tomcat_logs_path_d="PATH"
tomcat_logs_path_d="PATH"
tomcat_logs_path_e="PATH"
tomcat_logs_path_f="PATH"
#API项目日志
project_logs_path_a="PATH"
project_logs_path_b="PATH"
project_logs_path_c="PATH"
project_logs_path_d="PATH"
project_logs_path_e="PATH"
project_logs_path_f="PATH"
project_logs_path_g="PATH"
project_logs_path_h="PATH"
#DAO项目日志
project_logs_path_i="PATH"
project_logs_path_j="PATH"
project_logs_path_k="PATH"
project_logs_path_l="PATH"
project_logs_path_m="PATH"
project_logs_path_n="PATH"
project_logs_path_o="PATH"
#码库文件位置 PATH"
BACKUP_DIR_A="/data/var/log/cloud2/cy/"
BACKUP_DIR="/tmpzipfile/barcode_api/dow/"
# delete the folder greater than 13 days Tomcat_logs
#find "${tomcat_logs_path_a}" -regex ".*\.txt\|.*\.log\|.*\.out" -type f -mtime +13 -exec rm {} \;
#find "${tomcat_logs_path_b}" -regex ".*\.txt\|.*\.log\|.*\.out" -type f -mtime +13 -exec rm {} \;
#find "${tomcat_logs_path_c}" -regex ".*\.txt\|.*\.log\|.*\.out" -type f -mtime +13 -exec rm {} \;
#find "${tomcat_logs_path_d}" -regex ".*\.txt\|.*\.log\|.*\.out" -type f -mtime +13 -exec rm {} \;
#find "${tomcat_logs_path_e}" -regex ".*\.txt\|.*\.log\|.*\.out" -type f -mtime +13 -exec rm {} \;
#find "${tomcat_logs_path_f}" -regex ".*\.txt\|.*\.log\|.*\.out" -type f -mtime +13 -exec rm {} \;
#压缩tomcat日志
find ${tomcat_logs_path_a} -name "*${tomcat_date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${tomcat_logs_path_b} -name "*${tomcat_date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${tomcat_logs_path_c} -name "*${tomcat_date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${tomcat_logs_path_d} -name "*${tomcat_date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${tomcat_logs_path_e} -name "*${tomcat_date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${tomcat_logs_path_f} -name "*${tomcat_date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
#压缩项目日志
find ${project_logs_path_a} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_b} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_c} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_d} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_e} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_f} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_g} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_h} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_i} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_j} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_k} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_l} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_m} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_n} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_o} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
find ${project_logs_path_} -name "*${date}*" -type f|xargs -I {} tar zcvf {}.tar.gz --remove-files {}
echo "压缩日志完毕"