Loading ...
Sorry, an error occurred while loading the content.

Need Mysql backup class

Expand Messages
  • bhavna_coolinus
    Hi all I am looking for a class which takes Mysql database backup (dump). can any give me some examples which are mostly used. Thanks, Bhavna.
    Message 1 of 2 , Oct 19, 2007
    • 0 Attachment
      Hi all I am looking for a class which takes Mysql database backup
      (dump). can any give me some examples which are mostly used.


      Thanks,
      Bhavna.
    • G.
      hey, if you are with linux then I personally say use cron of unix shell file which will take your mysql backup. use this sipple script. set the cron for say
      Message 2 of 2 , Oct 21, 2007
      • 0 Attachment
        hey,


        if you are with linux then I personally say use cron of unix shell file
        which will take your mysql backup.
        use this sipple script.

        set the cron for say every week and thats it. you are done. :)

        #!/bin/bash
        # modify the following to suit your environmentexport
        DB_BACKUP="/backup/mysql_backup"export DB_USER="user_name"export
        DB_PASSWD="pass_word"
        # title and versionecho ""echo "mySQL_backup"echo
        "----------------------"echo "* Rotating backups..."

        # this is to take the backup of old backup file, use this files when
        you have more then 4 backup. else remove some lines. rm -rf
        $DB_BACKUP/04mv $DB_BACKUP/03 $DB_BACKUP/04mv $DB_BACKUP/02
        $DB_BACKUP/03mv $DB_BACKUP/01 $DB_BACKUP/02mkdir $DB_BACKUP/01
        echo "* Creating new backup..."mysqldump --user=$DB_USER
        --password=$DB_PASSWD --all-databases | bzip2 >
        $DB_BACKUP/01/mysql-`date +%Y-%m-%d`.bz2echo
        "----------------------"echo "Done"exit 0

        --
        ThanQ.
        Ganu.


        On 10/19/07, bhavna_coolinus <bhavna_coolinus@...> wrote:
        >
        > Hi all I am looking for a class which takes Mysql database backup
        > (dump). can any give me some examples which are mostly used.
        >
        > Thanks,
        > Bhavna.
        >
        >
        >


        [Non-text portions of this message have been removed]
      Your message has been successfully submitted and would be delivered to recipients shortly.