Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View nicolad's full-sized avatar
🎯
Focusing

Vadim Nicolai nicolad

🎯
Focusing
View GitHub Profile
@nicolad
nicolad / dump.sh
Created November 17, 2016 15:27 — forked from andsens/dump.sh
Backup all MySQL databases into separate files
#!/bin/sh
## backup each mysql db into a different file, rather than one big file
## as with --all-databases. This will make restores easier.
## To backup a single database simply add the db name as a parameter (or multiple dbs)
## Putting the script in /var/backups/mysql seems sensible... on a debian machine that is
## Create the user and directories
# mkdir -p /var/backups/mysql/databases
# useradd --home-dir /var/backups/mysql --gid backup --no-create-home mysql-backup
## Remember to make the script executable, and unreadable by others