Skip to content

Instantly share code, notes, and snippets.

@dgeske
Created March 1, 2013 16:00
Show Gist options
  • Save dgeske/5065588 to your computer and use it in GitHub Desktop.
Save dgeske/5065588 to your computer and use it in GitHub Desktop.
Backup All MySQL Databases into Individual Gzipped Files in Current Directory
for db in $(mysql -e 'show databases' -s --skip-column-names); do mysqldump $db | gzip > "$db-$(date +%Y-%m-%d).sql.gz"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment