{"id":112428,"date":"2018-07-26T08:58:44","date_gmt":"2018-07-26T00:58:44","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=112428"},"modified":"2018-07-23T09:00:27","modified_gmt":"2018-07-23T01:00:27","slug":"mysql-innobackupex","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/mysql-innobackupex.html","title":{"rendered":"\u5e72\u8d27\uff1aMySQL\u589e\u91cf\u5907\u4efd\u811a\u672c"},"content":{"rendered":"
1 \u3001\u7ebf\u4e0a\u73af\u5883\u6709\u65f6\u5019\u8003\u8651\u5230\u9700\u8981\u505a\u589e\u91cf\u5907\u4efd\u6570\u636e\u5e93\uff0c\u6240\u4ee5\u5199\u4e86\u4e2a\u7b80\u5355\u7684\u811a\u672c<\/p>\n
2 \u3001\u6dfb\u52a0\u81ea\u52a8\u4efb\u52a1\u6bcf\u5c0f\u65f6\u6216\u8005\u66f4\u77ed\u65f6\u95f4\u6267\u884c\u5c31\u597d\u4e86<\/p>\n
\r\n#!\/bin\/sh\r\n#author RuM\r\n#date 2015-07-10\r\nBAKDIR=\/tmp\/mysqlbak\r\nBAKDIR_FULL=$BAKDIR\/full\r\nBAKDIR_ADD=$BAKDIR\/add\r\nCONF=\/etc\/my.cnf\r\npasswd=123456\r\nINNOBACKUPEX=\/usr\/bin\/innobackupex\r\n<\/pre>\n\u7b2c\u4e00\u6b21\u6267\u884c\u4f1a\u505a\u4e00\u6b21\u5168\u5907\u8ddf\u589e\u5907\uff0c\u4ee5\u540e\u6267\u884c\u90fd\u4f1a\u662f\u589e\u91cf\u5907\u4efd<\/p>\n
\r\nif [ -f \"$INNOBACKUPEX\" ]\r\n then\r\n if [ -d \"$BAKDIR\" ]\r\n then\r\n echo \"is ok\"\r\n else\r\n mkdir $BAKDIR_FULL -p\r\n mkdir $BAKDIR_ADD -p \r\n fi\r\n<\/pre>\n\u5168\u5907<\/p>\n
\r\nfiles=`ls $BAKDIR_FULL`\r\n if [ -z \"$files\" ]\r\n then\r\n $INNOBACKUPEX --defaults-file=$CONF --user=root --password=$PASSWD $BAKDIR_FULL\r\n FULLNAME=$(dir \"$BAKDIR_FULL\")\r\n $INNOBACKUPEX --defaults-file=$CONF --user=root --password=$PASSWD --incremental-basedir=$BAKDIR_FULL\/$FULLNAME\/ --incremental $BAKDIR_ADD\r\n else\r\n<\/pre>\n\u589e\u91cf\u5907\u4efd<\/p>\n
\r\n ADDNAME=$(ls -lt $BAKDIR_ADD |sed -n 2p|awk '{print $9}')\r\n $INNOBACKUPEX --defaults-file=$CONF --user=root --password=$PASSWD --incremental-basedir=$BAKDIR_ADD\/$ADDNAME\/ --incremental $BAKDIR_ADD\r\n fi\r\n else\r\n echo \"is not install innobackupex\"\r\nfi\r\n<\/pre>\n\n\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.linuxde.net\/2015\/09\/15710.html<\/a><\/p>\n