nginx日志切割
nginx日志切割
#!/bin/sh #nginx日志切割 #设置 Log_path=/www/server/nginx/logs Yesterday=$(date -d "yesterday" +%Y-%m-%d_%S) Nginxbin=/www/server/nginx/sbin/nginx #日志改名 /bin/mv $Log_path/access.log $Log_path/access.$Yesterday.log /bin/mv $Log_path/error.log $Log_path/error.$Yesterday.log #重新生成日志 $Nginxbin -s reopen # #定时任务 # #nginx日志切割 # 00 00 * * * /root/sh/cut_log.sh # #
本文来自博客园,作者:blog-elvin-vip,转载请注明原文链接:https://www.cnblogs.com/elvi/p/7717986.html