Skip to content

Instantly share code, notes, and snippets.

@fnkr
Last active May 30, 2018 06:45
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fnkr/64744dbf789aaf4e46c5ca5eb7a4aa7d to your computer and use it in GitHub Desktop.
Save fnkr/64744dbf789aaf4e46c5ca5eb7a4aa7d to your computer and use it in GitHub Desktop.
MySQL/MariaDB server backup in 147 chars
echo 'show databases;' | sudo mysql | tail -n+2 | grep -v _schema$ | grep -v ^mysql$ | xargs -n 1 -I _ bash -c 'sudo mysqldump _ | gzip > _.sql.gz'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment