1 #!/bin/bash
2 log_files_path="/var/www/html/phpjx_ngx"
3 log_files_dir=${log_files_path}/access_$(date -d "yesterday" +"%Y")$(date -d "yesterday" +"%m")$(date -d "yesterday " +"%d")
4 echo $log_files_dir
5 nginx_sbin="/usr/local/nginx/sbin/nginx"
6 mv ${log_files_path}/access.log $log_files_dir
7 $nginx_sbin -c /usr/local/nginx/conf/nginx.conf -s reload
8