一、日志切割脚本
#!/bin/sh #nginx目录 BASE_DIR=/usr/local/nginx #生成的日志 BASE_FILE_NAME=jonychen.access.log CURRENT_PATH=$BASE_DIR/logs BAK_PATH=$BASE_DIR/datalogs CURRENT_FILE=$CURRENT_PATH/$BASE_FILE_NAME BAK_TIME=`/bin/date -d yesterday +%Y%m%d%H%M` BAK_FILE=$BAK_PATH/$BAK_TIME-$BASE_FILE_NAME echo $BAK_FILE $BASE_DIR/sbin/nginx -s stop mv $CURRENT_FILE $BAK_FILE $BASE_DIR/sbin/nginx