Created
July 30, 2020 04:44
-
-
Save suryanto/1d1a072cb625945edc06a1e8ed262761 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
TMP="/home/dev" | |
DB_USER="root" | |
DB_PASSWD="root" | |
DB="permata" | |
VERSION=`date +%F` | |
TABLES=`mysql --skip-column-names -e 'show tables' --user=${DB_USER} --password=${DB_PASSWD} ${DB}` | |
TABLES2=`echo "$TABLES" | grep -Ev "^(cache_.*|cachetags|sessions|watchdog)$"` | |
mysqldump --complete-insert --disable-keys --single-transaction --no-create-info --user=$DB_USER --password=$DB_PASSWD $DB $TABLES2 >> $TMP/$DB-$VERSION.sql | |
#Gzip everything | |
gzip -v $TMP/$DB-$VERSION.sql; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment