{"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

\u672c\u6587\u5730\u5740\uff1ahttps:\/\/lrxjmw.cn\/mysql-innobackupex.html<\/a>\u7f16\u8f91\uff1a\u4f55\u4e91\u8273\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"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 2 \u3001\u6dfb\u52a0\u81ea\u52a8\u4efb\u52a1\u6bcf\u5c0f\u65f6\u6216\u8005\u66f4\u77ed\u65f6\u95f4\u6267\u884c […]<\/p>\n","protected":false},"author":1479,"featured_media":31538,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-112428","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/112428","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1479"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=112428"}],"version-history":[{"count":6,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/112428\/revisions"}],"predecessor-version":[{"id":112474,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/112428\/revisions\/112474"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/31538"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=112428"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=112428"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=112428"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}