#!/bin/bash
# Define the folder path
BACKUP_DIR="/02-db-backup"
# Find and delete .sql files older than 10 days
find "$BACKUP_DIR" -name "*.sql" -type f -mtime +10 -exec rm -f {} \;
# Log the action (optional)
echo "Deleted .sql files older than 1 day from $BACKUP_DIR on $(date)" >> /var/log/backup_cleanup.log