Find the answer to your Linux question:
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 ...
  1. #1
    Just 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.

  2. #2
    Just 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...