Veritas-bu

Re: [Veritas-bu] AUTOMATE MYSQL DUMP BACKUP

2014-05-20 15:18:52
Subject: Re: [Veritas-bu] AUTOMATE MYSQL DUMP BACKUP
From: Anurag Sharma <sharma.anurag AT hotmail DOT com>
To: "mian71 AT gmail DOT com" <mian71 AT gmail DOT com>
Date: Wed, 21 May 2014 00:48:44 +0530
All,
 
Thank you for your help.
 
Finally I got it working by adding bpbackup command in the end.
 
Now the problem I am facing is Üser Backup is running 4 to 5 times instead of just once. What could be the reason for that ??
 
Here's  the script I am using .
 
----------------------------------------------------------------------------------------------------------------------------------------
 
#!/bin/bash

#The below command will delete the older backup
rm -r /mysql_backup/201*
 
TIMESTAMP=$(date +"%Y%m%d")
BACKUP_DIR="/mysql_backup/$TIMESTAMP"
MYSQL_USER="mysqlbak"
MYSQL_PASSWORD="Cricket1"
MYSQL=/usr/bin/mysql
# MYSQLDUMP=/usr/bin/mysqldump
MYSQLDUMP=/usr/mysql/5.1/bin/mysqldump
mkdir -p $BACKUP_DIR
databases=`$MYSQL -u$MYSQL_USER -p$MYSQL_PASSWORD -e "SHOW DATABASES;" | egrep -iv "(Database|information_schema)"`
for db in $databases; do
# echo $db
mkdir -p $BACKUP_DIR/$db
BACKUP_DIRR="/mysql_backup/$TIMESTAMP/$db"
$MYSQLDUMP --force --opt --user=$MYSQL_USER -p$MYSQL_PASSWORD --databases $db | gzip > "$BACKUP_DIRR/$db.sql.gz"

#The below command will start NetBackup Tape backups
/usr/openv/netbackup/bin/./bpbackup -w -p SOPMYSQL02 -s sopmysql02-backup /mysql_backup/
 
done
------------------------------------------------------------------------------------------------------------------------
 

CC: veritas-bu AT mailman.eng.auburn DOT edu; veritas-bu-bounces AT mailman.eng.auburn DOT edu
From: mian71 AT gmail DOT com
Subject: Re: [Veritas-bu] AUTOMATE MYSQL DUMP BACKUP
Date: Tue, 20 May 2014 07:15:24 +0200
To: sharma.anurag AT hotmail DOT com

Hi Anurag

Yes you would to use bpstart_notify and bpend_notify for this

bpstart_notify to call the backup.sh and bpend_notify to delete the dump after successfull backup

Regards
Michael

Sendt fra min iPad

Den 19/05/2014 kl. 21.57 skrev Anurag Sharma <sharma.anurag AT hotmail DOT com>:

Hi All,

Here's my situation.

MASTER/MEDIA : Solaris 10

Client : Linux/Solaris


There is a backup script created by mysql admin lets call it backup.sh  which can do on demand  mysql dump on a directory

/mysql_backup/yyyymmdd. It mean every time you run the script it will create a folder with that date.



I have been told to backup these dump files as standard backup.

I need following accomplished.

1. Need to call backup.sh to perform mysql dump and crate dump in /mysql_backup/yyyyymmdd
2. Run netbackup backup to backup the dump.
3. Once the netbackup backup is successful delete the dump from disk.


What would be the best way to do it via netbackup ? Do I have to use bpstart and bpend scripts on each client ?


Please guide.

Anurag Sharma




_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu
_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu