#!/bin/bash # OG 日志清理 - 删除30天前的日志文件 LOG_DIR="/www/wwwroot/Socket/runtime/log" find "$LOG_DIR" -name "*.log" -type f -mtime +30 -delete 2>/dev/null find "$LOG_DIR" -type d -empty -delete 2>/dev/null echo "[$(date)] log cleanup done, current size: $(du -sh $LOG_DIR | cut -f1)"