#!/bin/bash
logs_path=/usr/local/nginx/logs
yesterday=$(date -d "yesterday" +%Y-%m-%d)
mv ${logs_path}/access.log ${logs_path}/access_${yesterday}.log
mv ${logs_path}/error.log ${logs_path}/error_${yesterday}.log
kill -USR1 $(cat /usr/local/nginx/logs/nginx.pid)
阅读(1682) | 评论(0) | 转发(0) |