#!/bin/bash

# The script is will run at 00:00

# Make u

# Nginx日志文件的存放路径

logs_path="/data1/logs"

 

mkdir -p ${logs_path}$(date -d "yesterday" +"%Y")/$(data -d "yesterday" +"%m")/

mv ${logs_path}access.log  ${logs_path}$(date -d "yesterday" +"%Y")/$(data -d "yesterday" +"%m")/access_$(data -d "yesterday" +"%Y%m%d").log

kill  -USR1 `cat /usr/local/webserver/nginx/nginx.pid`

 

 

在crontab -e。