#!/bin/bash LOG_DIR="/opt/microdao-daarion/logs" RETENTION_DAYS=7 find "$LOG_DIR" -name "*.log.*" -type f -mtime +$RETENTION_DAYS -delete find "$LOG_DIR" -name "*.log" -type f -mtime +$RETENTION_DAYS -exec gzip {} \;