nginx切割日志

 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 
    A+
发布日期:2014年04月24日  所属分类:未分类

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: