Welcome! » Log In » Create A New Profile


Posted by Anonymous 
May 20, 2014 08:56PM
D’oh – realized I’d not sent this to the list but just to the OP.

How many databases (or more appropriately how many distinct items) are output by the command:

databases=`$MYSQL -u$MYSQL_USER -p$MYSQL_PASSWORD -e "SHOW DATABASES;" | egrep -iv "(Database|information_schema)"

Your for loop is telling it to run the backup for each database produced by the above command. If you have 4-5 then that is the problem. You probably want to put the “done” FROM the end of your script BEFORE that line so it does the dump of each database but then only does the backup after they’ve all been dumped.

Alternatively you could add logic to do the backup of each dump individually.

[b]From:[/b] veritas-bu-bounces < at > mailman.eng.auburn.edu [mailto] [b]On Behalf Of [/b]Anurag Sharma
[b]Sent:[/b] Tuesday, May 20, 2014 3:19 PM
[b]To:[/b] mian71 < at > gmail.com
[b]Cc:[/b] veritas-bu; veritas-bu2
[b]Subject:[/b] Re: [Veritas-bu] AUTOMATE MYSQL DUMP BACKUP


Thank you for your help.

Finally I got it working by adding bpbackup command in the end.

Now the problem I am facing is [b]Üser Backup [/b]is running 4 to 5 times instead of just once. What could be the reason for that ??

Here's the script I am using .



#The below command will delete the older backup
rm -r /mysql_backup/201*

TIMESTAMP=$(date +"%Y%m%d")
# MYSQLDUMP=/usr/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
$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/


CC: veritas-bu < at > mailman.eng.auburn.edu ([email]veritas-bu < at > mailman.eng.auburn.edu[/email]); veritas-bu-bounces < at > mailman.eng.auburn.edu ([email]veritas-bu-bounces < at > mailman.eng.auburn.edu[/email])
From: mian71 < at > gmail.com ([email]mian71 < at > gmail.com[/email])
Subject: Re: [Veritas-bu] AUTOMATE MYSQL DUMP BACKUP
Date: Tue, 20 May 2014 07:15:24 +0200
To: sharma.anurag < at > hotmail.com ([email]sharma.anurag < at > hotmail.com[/email])
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



Sendt fra min iPad

Den 19/05/2014 kl. 21.57 skrev Anurag Sharma <sharma.anurag < at > hotmail.com ([email]sharma.anurag < at > hotmail.com[/email])>:
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.edu ([email]Veritas-bu < at > mailman.eng.auburn.edu[/email])

Athena®, Created for the Cause™
Making a Difference in the Fight Against Breast Cancer
CONFIDENTIALITY NOTICE: This e-mail may contain privileged or confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.
Sorry, you do not have permission to post/reply in this forum.