Compress gc logs and move gc log

#!/bin/bash

SOURCE_DIR="/your/path/dir"
DEST_DIR="/your/dest/dir"

find "$SOURCE_DIR" -type f -name "*.gc.*" -mtime +30 -not -name "*.gz" -exec gzip {} \;

mkdir -p "$DEST_DIR" mv "$SOURCE_DIR"/*.gz "$DEST_DIR"/ 2>/dev/null

Comments

Popular posts from this blog

Fixing the DeepSpeed Import Error While Fine-Tuning the Qwen Model

Amazon Linux 2023 - User data configuration for launch templates to connect to the EKS cluster

How to create ISM policy and rotate logs in opensearch