Results 1 to 2 of 2
Hi every one,
I am new to shell scripting, and have a question regarding MySQL dumps.
I have a file (text) , MySQL dumps. I would like to write a ...
- 04-28-2010 #1Just Joined!
- Join Date
- Apr 2010
- Posts
- 1
mysql dump file and bash script.
Hi every one,
I am new to shell scripting, and have a question regarding MySQL dumps.
I have a file (text) , MySQL dumps. I would like to write a bash script that will dynamically generate sql dumps for each database, and save the output to files named after the database.
Can anyone tell me how to start coding, and what I need to use, in order to accomplish this.
Thanks.
- 04-29-2010 #2Just Joined!
- Join Date
- Apr 2010
- Posts
- 7
Hello,
Hope following script will help you to take backup
if [ -d /Backupfolderpath/`date +%a` ] ; then
/usr/bin/mysqldump \
--user=mysqluser \
--password=password \
--databases databasename database > \
/Backupfolderpath/`date +%a`/database.sql
else
echo "Target directory /Backupfolderpath/`date +%a` does not exist"
fi
PS:: linuxforums.org/forum/other-distributions/163328-command-problem.html


Reply With Quote