#!/bin/bash#The owner is Echo.Atlasmtime=`stat -c %Y /logs/blackhole/main.log`systime=`date +%s`if [ $[ $systime - $mtime ] -gt 21600 ]then echo "This file has been updated
vi /etc/logrotate.d/nginx #编辑脚本/usr/local/nginx/logs/*.log /usr/local/nginx/logs/nginx_logs/*.log{missingok #忽略错误,如“日志文件无法找到”的错误提示。dateext #切换后的日志文件会附加上一个短横线和YYYYMMDD格式的日期,没有这个配置项会附
Copyright © 2005-2025 51CTO.COM 版权所有 京ICP证060544号