Skip to content

Instantly share code, notes, and snippets.

View ecdundar's full-sized avatar

ecdundar

View GitHub Profile
@Thinkscape
Thinkscape / mysql-backup-all.sh
Created March 27, 2012 11:38
Backup all mysql databases to separate archives, each table in separate file.
#!/bin/bash
#
# Backup all databases to separate archives.
# 1. Each table is dumped into separate *.sql file.
# 2. Each view is dumped into separate file with DEFINER=CURRENT_USER.
# 3. All routines are dumped into routines-dbname.sql,
# 4. All files are added to archive dbname.7z, compressed with 7-zip, max compression.
#
# Usage: mysqlback.sh /output/directory
#