Skip to content

Instantly share code, notes, and snippets.

@DarkMukke
Created February 12, 2016 16:44
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 DarkMukke/a487cd3d0bcdadd9f6f6 to your computer and use it in GitHub Desktop.
Save DarkMukke/a487cd3d0bcdadd9f6f6 to your computer and use it in GitHub Desktop.
config="app/etc/local.xml"; u=`sed -n 's/.*<username><!\[CDATA\[\(.*\)]]><\/username>/\1/p' $config`;n=`sed -n 's/.*<dbname><!\[CDATA\[\(.*\)]]><\/dbname>/\1/p' $config`;p=`sed -n 's/.*<password><!\[CDATA\[\(.*\)]]><\/password>/\1/p' $config`;mysqldump -u $u -p"${p}" $n > ~/${n}_$(date +"%Y_%m_%d")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment