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 eduFrom:
mian71 AT gmail DOT comSubject: Re: [Veritas-bu] AUTOMATE MYSQL DUMP BACKUP
Date: Tue, 20 May 2014 07:15:24 +0200
To:
sharma.anurag AT hotmail DOT comHi 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
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