nginx日志切分shell脚本

#!/bin/bash
log_path="/usr/local/nginx/logs/"
mv ${log_path}eshop_access.log ${log_path}eshop_access_$(date -d "yesterday" +%Y_%m_%d).log
nginx_pid=`ps aux |grep -E 'nginx: master process'|grep -v 'grep'|awk '{print $2}'`
kill -USR1 $nginx_pid

 

posted @ 2016-08-10 14:16  路漫漫灬  阅读(223)  评论(0编辑  收藏  举报