Dump All MySQL Databases Starting with Prefix

 

Hello,

 

The following shell/bash script will help you in taking backup of databases starting with prefix.

 

#!/bin/bash
#Script for mysql database backup

cd /var/lib/mysql
#Path to mysql folder I am using default path here
for DBs in $(ls -d */ |grep dbprefix_ | tr -d /)
do

cd /mysqlbackup

`mysqldump -u root -p'password' $DBs > $DBs.sql`


done

One comment

  1. cheap nhl hats says:

    I??l immediately grab types rss or atom when i can?? discover your own postal mail membership web address or even e-newsletter providers. Perform you might have any kind of?

Leave a Reply

Protected by WP Anti Spam