Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made a version of the script that creates a gziped MySQLDump of the W…

…ordPress database.
  • Loading branch information...
commit 4e6212222d51aa8319ccccbf80a974615769d48e 1 parent 9b7565a
@brianlayman authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 wpbak
View
7 wpbak
@@ -0,0 +1,7 @@
+#!/bin/bash
+sqlname=$(sed -n "/define('DB_NAME', '/s/.*, '\([^']*\).*/\1/p" $1)
+sqluser=$(sed -n "/define('DB_USER', '/s/.*, '\([^']*\).*/\1/p" $1)
+sqlpass=$(sed -n "/define('DB_PASSWORD', '/s/.*, '\([^']*\).*/\1/p" $1)
+sqlhost=$(sed -n "/define('DB_HOST', '/s/.*, '\([^']*\).*/\1/p" $1)
+
+mysqldump --host=$sqlhost --user=$sqluser -p$sqlpass --skip-lock-tables $sqlname | gzip -9 > $sqlname.sql.gz
Please sign in to comment.
Something went wrong with that request. Please try again.