Announcement

Announcement Module
Collapse
No announcement yet.

Using MYSQL Hotbackup

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using MYSQL Hotbackup

    Hello,

    I intend to use MYSQLHotbackup , i.e mysqlhotcopy.

    We have MYSQL on linux box with 2.6 version and MYSQL 5.0.22 version.

    I wanted to know if MYSQL hotbackup can be done on Linux systems and the steps requierd to install.

    Thanks

  • #2
    Yes, it works on linux. For installation and usage docs, read http://www.innodb.com/support/documentation/innodb-hot-backu p-manual/ this doc.

    Comment


    • #3
      Hi,

      I am trying to run this code:

      #!/bin/sh
      DBHOST='localhost'
      DBUSER='root'
      DBPASSWD='pwd'
      FTPHOST='0.0.0.0'
      FTPUSER='user'
      FTPPASSWD='pwd'
      LOCALDIR=/home/path/
      REMOTEDIR=/var/path/
      TARPREFIX=db1
      cd $LOCALDIR SUFFIX='eval date +%y%m%d'
      DBS='mysql -u$DBUSER -p$DBPASSWD -h$DBHOST -e"show databases"'
      for DATABASE in $DBS do if [$DATABASE!="Database"]; then FILENAME=$SUFFIX-$DATABASE.tar.gz
      mysqlhotcopy -u $DBUSER -p $DBPASSWD $DATABASE $LOCALDIR tar -czf
      $LOCALDIR $FILENAME $LOCALDIR $DATABASE rm -rf $LOCALDIR $DATABASE rm rf
      $LOCALDIR $DATABASE -replicate fi
      done
      chmod 400 $LOCALDIR*.tar.gz tar -cf $TARPREFIX-$SUFFIX.tar
      $SUFFIX-*.tar.gz ftp -n $FTPHOST <


      But it throws me an error :


      ./backup.sh: line 13: syntax error near unexpected token `then'
      ./backup.sh: line 13: `for DATABASE in $DBS do if [$DATABASE!="Database"]; then FILENAME=$SUFFIX-$DATABASE.tar.gz'

      How can I correct this.

      Thanks

      Comment


      • #4
        Try to add spaces around square brackets ("]" and "[") in your IF statement.

        Comment


        • #5
          Nope , that did not help. Returning the same error.

          Comment


          • #6
            for DATABASE in $DBS___;___ do

            Comment


            • #7
              #!/bin/shDBHOST='localhost'DBUSER='root'DBPASSWD='pwd'FTP HOST='0.0.0.0'FTPUSER='user'FTPPASSWD='pwd'<-- You dont need to quote the values[snip]cd $LOCALDIR SUFFIX='eval date +%y%m%d'<-- I would recommend using $(date..)<-- With '' as quoting it wouldnt work anyway<-- AFAIK (on linux) SUFFIX would "executed" in a "subshell"DBS='mysql -u$DBUSER -p$DBPASSWD -h$DBHOST -e"show databases"'for DATABASE in $DBS do if [$DATABASE!="Database"]; then <-- for DATABASE in $DBS ; do if [ $DATABASE!="Database" ]; then <-- as scoundrel remarkedFILENAME=$SUFFIX-$DATABASE.tar.gzmysqlhotcopy -u $DBUSER -p $DBPASSWD $DATABASE $LOCALDIR tar -czf$LOCALDIR $FILENAME $LOCALDIR $DATABASE rm -rf $LOCALDIR <-- I think the Space between $LOCALDIR and $FILENAME etc. is wrong$DATABASE rm rf$LOCALDIR $DATABASE -replicate fi<-- I think the Space between $LOCALDIR and $DATABASE is wrongdonechmod 400 $LOCALDIR*.tar.gz tar -cf $TARPREFIX-$SUFFIX.tar<-- I dont get your chmod$SUFFIX-*.tar.gz ftp -n $FTPHOST <<-- I dont get this either

              Comment

              Working...
              X