nginx日志切割脚本

nginx日志切割脚本
#!/bin/bash # The Nginx logs path logs_path="/data0/logs" logs_dir=${logs_path}/$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m") logs_file=$(date -d "yesterday" +"%Y%m%d") mkdir -p /data0/backuplogs/$(date -d "yesterday" +"%Y")/$(date -d "yesterday" +"%m") tar -czf ${logs_path}/${logs_file}.tar.gz ${logs_path}/*.log rm -rf ${logs_path}/*.log mv ${logs_path}/${logs_...
Copyright © 羽飞博客 保留所有权利.   Ality主题 皖ICP备14013844号-1

用户登录