Skip to content

Instantly share code, notes, and snippets.

@maneer17
Created June 22, 2025 14:29
Show Gist options
  • Save maneer17/a89791cc1cfcca7d27d489a87f38522c to your computer and use it in GitHub Desktop.
Save maneer17/a89791cc1cfcca7d27d489a87f38522c to your computer and use it in GitHub Desktop.
Clean Old Database backup files
#!/bin/bash
BACKUP_DB_DIR="/moodle-db-backups"
find "$BACKUP_DB_DIR" -type f -name "*.sql" -mtime +3 -delete
* 22 * * * /home/manar/clean-old-db-files.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment