nginx-日誌切割腳本

#!/bin/bash
#

LOGS_PATH=/opt/nginx/logs

YESTERDAY=$(date -d "yesterday" +%Y-%m-%d)

mv -f ${LOGS_PATH}/web項目名.access.log ${LOGS_PATH}/web項目名.access_${YESTERDAY}.log

mv -f ${LOGS_PATH}/error.log ${LOGS_PATH}/error_${YESTERDAY}.log

kill -s USR1 `cat /opt/nginx/logs/nginx.pid`
相關文章
相關標籤/搜索