标签:path span tab nginx日志切割 access error yesterday sbin usr
#!/bin/bash #日志切割 LOGS_PATH=/mnt/nginxlogs 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 /usr/local/nginx/sbin/nginx -s reload
crontab每天凌晨0:00运行
将NGXIN日志根据天为单位进行切割。
标签:path span tab nginx日志切割 access error yesterday sbin usr
原文地址:https://www.cnblogs.com/colinshi/p/9542850.html