2026-09-29 来自北京市
log" -type f -mtime +$RETENTION_DAYS -exec rm -f {} \; # 记录清理操作日志 echo "Cleaned logs older than $RETENTION_DAYS days on $(date)" >> /var/log/log_cleanup
测试环境先模拟 :在服务器上首次部署时,建议先用 ls 或 echo 代替 rm 测试脚本逻辑,确认无误后再启用删除操作
责编:PN95935