nginx访问日志轮询切割
#!/bin/sh Dataformat=`date +%Y-%m-%d-%H:%M:%S` Basedir="/application/nginx" Nginxlogdir="$Basedir/logs" Logname="access_www" [ -d $Nginxlogdir ] && cd $Nginxlogdir || exit 1 [ -f ${Logname}.log ] || exit 1 /bin/mv ${Logname}.log ${Dataformat}_${Logname}.log $Basedir/sbin/nginx -s reload
[root@lnmp logs]# crontab -l
*/1 * * * * /bin/sh /home/yang/cut_nginx_log.sh >/dev/null 2 >&1
原文:http://www.cnblogs.com/augustyang/p/6493297.html