Skip to content

Instantly share code, notes, and snippets.

@danielhauck
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielhauck/cd84813b9beb0925184f to your computer and use it in GitHub Desktop.
Save danielhauck/cd84813b9beb0925184f to your computer and use it in GitHub Desktop.
Quick and dirty mysql backup
#!/usr/bin/env bash
for DATABASE in $(mysql -NBqe 'show databases' | grep -Ev "(information_schema|performance_schema)"); do
mysqldump --events ${DATABASE} | gzip > /srv/backup/$(date +%Y%m%d_%H%M)_${DATABASE}.gz;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment