Skip to content

Instantly share code, notes, and snippets.

@dansku
Created September 24, 2014 13:15
Show Gist options
  • Select an option

  • Save dansku/40146ab4ff831c139cd7 to your computer and use it in GitHub Desktop.

Select an option

Save dansku/40146ab4ff831c139cd7 to your computer and use it in GitHub Desktop.
Backup
#!/bin/bash
for database in $(mysql -e "show databases"|awk -F " " '{print $1}'); do
mysqldump $database | gzip -9 > $database.sql.gz
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment