nginx热部署已经日志热切割

https://www.cnblogs.com/wupeixuan/p/11780405.html

 

#!/bin/bash

LOGS_PATH=/var/log/nginx
YESTERDAY=$(date -d "yesterday" +%Y-%m-%d)


cd $LOGS_PATH
mv emm_igesafe.log logs/emm_igesafe_${YESTERDAY}.log
gzip logs/emm_igesafe_${YESTERDAY}.log
mv access.log logs/access_${YESTERDAY}.log
gzip logs/access_${YESTERDAY}.log
mv gstianfu.log logs/gstianfu_${YESTERDAY}.log
gzip logs/gstianfu_${YESTERDAY}.log
mv licai.log logs/licai_${YESTERDAY}.log
gzip logs/licai_${YESTERDAY}.log
mv igesafe.log logs/igesafe_${YESTERDAY}.log
gzip logs/igesafe_${YESTERDAY}.log
kill -USR1 $(cat /run/nginx.pid)
exit 0

 

posted @ 2020-05-20 16:20  第十一个程序员  阅读(126)  评论(0编辑  收藏  举报