nginx-log

  • 日誌的切割
    -bash-4.1# ll /bin/log.sh
    -rwxr-xr-x 1 root root 152 Aug 24 15:38 /bin/log.sh
    -bash-4.1# cat /bin/log.sh
    #!/bin/bash
    A=`date +%Y%m%d`
    B="access"
    mv /usr/local/nginx/logs/access.log /usr/local/nginx/logs/"${A}_${B}.log"
    /usr/local/nginx/sbin/nginx -s reload
    -bash-4.1# crontab -l
    */1 * * * * /bin/log.sh
相關文章
相關標籤/搜索