# /bin/bash logs_path="/data/wwwlogs/" #以前的日志文件。 log_name="xxx.log" pid_path="/usr/local/nginx/logs/nginx.pid" mv ${logs_path}${log_name} ${logs_path}${log_name}_$(date --date="LAST WEEK" +"%Y-%m-d").log kill -USR1 `cat ${pid_path}`
# /bin/bash logs_path="/data/wwwlogs/" #以前的日志文件。 log_name="xxx.log" pid_path="/usr/local/nginx/logs/nginx.pid" mv ${logs_path}${log_name} ${logs_path}${log_name}_$(date --date="LAST WEEK" +"%Y-%m-d").log kill -USR1 `cat ${pid_path}`