You can create scripts that you use to back up MySQL Database. You do not have to stop your database to perform a backup. You create the following two scripts to back up MySQL Database:
You can specify the scripts to run on the MySQL Database nodes in Pre/Post Scripts Settings of the Backup Wizard.
Follow these steps:
#!/bin/bash
dbuser=root
dbpwd=rootpwd
lock_mysqldb(){
(
echo "flush tables with read lock;"
sleep 5
) | mysql -u$dbuser -p$dbpwd ${ARGUMENTS}
}
lock_mysqldb &
PID="/tmp/mysql-plock.$!"
touch ${PID}
Note: Specify the value for dbuser and dbpwd variables as defined in your MySQL Database.
#!/bin/bash
killcids(){
pid="$1"
cids=`ps -ef|grep ${pid}|awk '{if('$pid'==$3){print $2}}'`
for cid in ${cids}
do
echo ${cid}
kill -TERM ${cid}
done
echo -e "\n"
}
mysql_lock_pid=`ls /tmp/mysql-plock.* | awk -F . '{print $2}'`
[ "$mysql_lock_pid" != "" ] && killcids ${mysql_lock_pid}
rm -fr /tmp/mysql-plock.*
/opt/Arcserve/d2dserver/usr/prepost/
The backup job is submitted.
The scripts are created to back up MySQL Database.
Note: Arcserve UDP Agent (Linux) supports the volume level snapshot. To ensure the data consistency, all data files of the database must be on one volume.
Copyright © 2016 |
|