User Tools

Site Tools


furnished_bckup_mysql

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

furnished_bckup_mysql [2009/05/02 03:13]
k2patel created
furnished_bckup_mysql [2009/11/13 00:20] (current)
k2patel
Line 39: Line 39:
  
 DB_USR=""​ DB_USR=""​
 +
 +# Specify your DB Host
 +
 +DB_HOST=""​
    
 # Ignore following databse from backup # Ignore following databse from backup
Line 45: Line 49:
    
 # Get list of all databases # Get list of all databases
-DB_LIST=`$mysql -Bse -u $DB_USR -p$DB_PASS 'show databases'​`+DB_LIST=`$mysql ​-h $DB_HOST ​-Bse -u $DB_USR -p$DB_PASS 'show databases'​`
    
 for db in $DB_LIST; do for db in $DB_LIST; do
Line 59: Line 63:
    
         if [ "​$skip"​ == "​0"​ ]; then         if [ "​$skip"​ == "​0"​ ]; then
-                $mysqldump $db | gzip -9 > $BACKUP_DIR/​$db.$DATE.sql.gz+                $mysqldump ​-R -h $DB_HOST -u $DB_USR -p$DB_PASS ​$db | $gzip -9 > $BACKUP_DIR/​$db.$DATE.sql.gz
  if [ "​$OWN_FILE"​ != ""​];​ then   if [ "​$OWN_FILE"​ != ""​];​ then 
  $chown $OWN_FILE $BACKUP_DIR/​$db.$DATE.sql.gz  $chown $OWN_FILE $BACKUP_DIR/​$db.$DATE.sql.gz
furnished_bckup_mysql.txt ยท Last modified: 2009/11/13 00:20 by k2patel