Skip to content

Instantly share code, notes, and snippets.

View BeshoyAtef's full-sized avatar

Beshoy Atef Zarif BeshoyAtef

View GitHub Profile
@BeshoyAtef
BeshoyAtef / bash_backup_all_mysql_databases.sh
Last active May 6, 2025 00:11 — forked from Zeuh/bash_backup_all_mysql_databases.sh
Bash scripts to backup all databases in a MySQL server with the option to exclude some databases.
#!/usr/bin/env bash
# Combined MySQL Database Management Script
# Allows EITHER deleting selected databases OR importing selected/all databases from .sql.gz files.
# WARNING: The delete function is EXTREMELY DANGEROUS and IRREVERSIBLE. Use with caution.
# REQUIREMENTS
## mysql client, gunzip, find, grep, sed (standard Linux tools)
## Bash v4+ recommended for mapfile (can be adapted for older Bash if needed)