#!/bin/bash
year=`date +%Y`
month=`date +%m`
date=`date +%d`
echo "清空/var/log"
cd /var/log
for i in `find . -name "*.log"`; do cat /dev/null >$i; done
echo "清空/usr/local/openresty/nginx/logs"
cd /usr/local/openresty/nginx/logs
for i in `find . -name "*.log"`; do cat /dev/null >$i; done

echo "清空/home/quant_group/logs"
cd /home/quant_group/logs
rm -rf *.log.*
rm -rf *-2017*.log
rm -rf *.log-*
for i in `find . -name "*.log"`; do cat /dev/null >$i; done

echo "清空/var/log/nginx"
cd /var/log/nginx
rm -rf *.gz *.log-*
for i in `find . -name "*.log"`; do cat /dev/null >$i; done

echo "清空/home/quant_group/op-api/logs"
cd /home/quant_group/op-api/logs
rm -rf *.log.*
for i in `find . -name "*.log"`; do cat /dev/null >$i; done

echo "清空/home/quant_group/AppBackend/logs"
cd /home/quant_group/AppBackend/logs

rm -rf `ls access*.log|grep -v  $year$month$date`
rm -rf `ls *.log_*.log|grep -v $year-$month-$date`
for i in `find . -name "*.log"`; do cat /dev/null >$i; done

echo "清空/home/quant_group/activity-op/logs"
cd /home/quant_group/activity-op/logs

rm -rf *.log.*
for i in `find . -name "*.log"`; do cat /dev/null >$i; done

echo "清空/home/quant_group/op-api/logs"
cd /home/quant_group/op-api/logs
rm -rf *.log.*
for i in `find . -name "*.log"`; do cat /dev/null >$i; done

echo "清空/tmp/"
rm -rf /tmp/*

echo "晴空 /home/quant_group/zookeeper-3.4.8/logs/version-2"
rm -rf /home/quant_group/zookeeper-3.4.8/logs/version-2/*

echo "清空pm2"
cd ~/.pm2
>pm2.log
cd ./logs
rm -rf *
