set master data option -m
This commit is contained in:
@@ -28,6 +28,8 @@ WARNING!!! This will block all applications.
|
|||||||
this option sets the transaction isolation mode to REPEATABLE READ and sends a START TRANSACTION SQL statement to the server before dumping data. It is useful only with transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time when START TRANSACTION was issued without blocking any applications.
|
this option sets the transaction isolation mode to REPEATABLE READ and sends a START TRANSACTION SQL statement to the server before dumping data. It is useful only with transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time when START TRANSACTION was issued without blocking any applications.
|
||||||
**-z, --compress**
|
**-z, --compress**
|
||||||
compress dump using gzip
|
compress dump using gzip
|
||||||
|
**-m, --master**
|
||||||
|
set master data in dump
|
||||||
**-q, --quiet**
|
**-q, --quiet**
|
||||||
**-h, --help**
|
**-h, --help**
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ usage()
|
|||||||
echo "-l | --lock-all-tables"
|
echo "-l | --lock-all-tables"
|
||||||
echo "-s | --single-transaction"
|
echo "-s | --single-transaction"
|
||||||
echo "-z | --compress :: gzip dump"
|
echo "-z | --compress :: gzip dump"
|
||||||
|
echo "-m | --master :: set master data"
|
||||||
echo "-q | --quiet :: silent mode"
|
echo "-q | --quiet :: silent mode"
|
||||||
echo "-h | --help :: display this help"
|
echo "-h | --help :: display this help"
|
||||||
}
|
}
|
||||||
@@ -51,6 +52,7 @@ while [ "${1}" != "" ]; do
|
|||||||
;;
|
;;
|
||||||
-z | --compress ) compress=1
|
-z | --compress ) compress=1
|
||||||
;;
|
;;
|
||||||
|
-m | --master ) master=1
|
||||||
-q | --quiet ) quiet=1
|
-q | --quiet ) quiet=1
|
||||||
;;
|
;;
|
||||||
-h | --help ) usage
|
-h | --help ) usage
|
||||||
@@ -100,8 +102,6 @@ mysqlparams=" --all-databases \
|
|||||||
--events \
|
--events \
|
||||||
--extended-insert \
|
--extended-insert \
|
||||||
--flush-privileges \
|
--flush-privileges \
|
||||||
--master-data \
|
|
||||||
--include-master-host-port \
|
|
||||||
--quick \
|
--quick \
|
||||||
--quote-names \
|
--quote-names \
|
||||||
--routines \
|
--routines \
|
||||||
@@ -118,6 +118,10 @@ if [ "${lock}" ] ; then
|
|||||||
mysqlparams="${mysqlparams} --lock-all-tables" ;
|
mysqlparams="${mysqlparams} --lock-all-tables" ;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${master}" ] ; then
|
||||||
|
mysqlparams="${mysqlparams} --master-data --include-master-host-port" ;
|
||||||
|
fi
|
||||||
|
|
||||||
prefix="mysqldump.`hostname -s`.${name}" ;
|
prefix="mysqldump.`hostname -s`.${name}" ;
|
||||||
|
|
||||||
if [ `ls ${dir} | grep ${prefix} | wc -l` -ge "${copies}" ] ; then
|
if [ `ls ${dir} | grep ${prefix} | wc -l` -ge "${copies}" ] ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user