{"id":137,"date":"2015-03-01T11:11:41","date_gmt":"2015-03-01T02:11:41","guid":{"rendered":"http:\/\/vicsfactory.com\/?p=137"},"modified":"2015-03-02T10:27:32","modified_gmt":"2015-03-02T01:27:32","slug":"%e3%83%a1%e3%82%a4%e3%83%b3%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%ae%e3%83%87%e3%83%bc%e3%82%bf%e3%82%92%e3%82%bb%e3%82%ab%e3%83%b3%e3%83%89%e3%82%b5%e3%83%bc%e3%83%90%e3%83%bc%e3%81%ab%e8%87%aa","status":"publish","type":"post","link":"https:\/\/vicsfactory.com\/?p=137","title":{"rendered":"\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u30bb\u30ab\u30f3\u30c9\u30b5\u30fc\u30d0\u30fc\u306b\u81ea\u52d5\u30d0\u30c3\u30af\u30a2\u30c3\u30d7"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>rsync\u3092\u4f7f\u3063\u3066\u6bce\u65e5\u81ea\u52d5\u7684\u306b\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5185\u90e8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5185\u306e\u30bb\u30ab\u30f3\u30c9\u30b5\u30fc\u30d0\u30fc\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u3002<\/p>\n<p>\u4f8b\uff1a<br \/>\n\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fcIP\u30a2\u30c9\u30ec\u30b9\uff1a192.168.1.100<br \/>\n\u30bb\u30ab\u30f3\u30c9\u30b5\u30fc\u30d0\u30fcIP\u30a2\u30c9\u30ec\u30b9\uff1a192.168.1.200<br \/>\n\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u30c7\u30fc\u30bf\uff1a<br \/>\n\/var\/www\/html\/<\/p>\n<p>\u25cf\u6e96\u5099<br \/>\n\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u306b\u5185\u90e8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u304b\u3089root\u3067SSH\u30ed\u30b0\u30a4\u30f3\u51fa\u6765\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u3066\u304a\u304f\u3002<\/p>\n<p>\u25cf\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a<\/p>\n<p>rsync\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3002<br \/>\n# yum install rsync<\/p>\n<p>\u9375\u306e\u4f5c\u6210<br \/>\n# ssh-keygen -t rsa<br \/>\n\u7a7a\u30a8\u30f3\u30bf\u30fc\u00d73\u56de\u3067\u7d42\u4e86<\/p>\n<p>\u516c\u958b\u9375\u3092\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u306b\u30b3\u30d4\u30fc<br \/>\n#\u00a0 scp \/root\/.ssh\/id_rsa.pub root@192.168.1.100:\/root\/<br \/>\nroot@192.168.1.100&#8217;s password:\u3000\u2190\u3000root\u306epassword\u5165\u529b<\/p>\n<p>\u25cf\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u306e\u8a2d\u5b9a<\/p>\n<p>.ssh\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3057\u3001\u30b3\u30d4\u30fc\u3055\u308c\u305fid_rsa.pub\u3092authorized_keys\u306b\u30ea\u30cd\u30fc\u30e0<br \/>\n# mkdir .ssh<br \/>\n# cat id_rsa.pub &gt;&gt; \/root\/.ssh\/authorized_keys<\/p>\n<p>authorized_keys2\u306e\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u306e\u5909\u66f4<br \/>\n# chmod 600 \/root\/.ssh\/authorized_keys<\/p>\n<p>\u4ee5\u4e0a\u3067rsync\u306e\u8a2d\u5b9a\u5b8c\u4e86\u3002<\/p>\n<p>\u25cf\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u306e\u81ea\u52d5\u5316<\/p>\n<p>\u30bb\u30ab\u30f3\u30c9\u30b5\u30fc\u30d0\u30fc\u3067\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b9\u30af\u30ea\u30d7\u30c8\u4f5c\u6210<br \/>\n# vi rsyncbackup.sh<br \/>\n#!\/bin\/sh<br \/>\nRSYNC=&#8217;rsync -avz -e ssh &#8211;delete&#8217;<br \/>\n$RSYNC 192.168.1.100:\/var\/www\/html\/ \/var\/www\/html\/<\/p>\n<p>rsyncbackup\u306b\u5b9f\u884c\u6a29\u9650\u4ed8\u52a0<br \/>\n# chmod +x rsyncbackup.sh<\/p>\n<p>\u6bce\u65e5\u5348\u524d3\u6642\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u81ea\u52d5\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u8a2d\u5b9a<br \/>\n# echo &#8220;0 3 * * * root \/root\/rsyncbackup.sh&#8221; &gt; \/etc\/cron.d\/rsyncbackup<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; rsync\u3092\u4f7f\u3063\u3066\u6bce\u65e5\u81ea\u52d5\u7684\u306b\u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fc\u306e\u30c7\u30fc\u30bf\u3092\u5185\u90e8\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u5185\u306e\u30bb\u30ab\u30f3\u30c9\u30b5\u30fc\u30d0\u30fc\u306b\u30d0\u30c3\u30af\u30a2\u30c3\u30d7\u3059\u308b\u3002 \u4f8b\uff1a \u30e1\u30a4\u30f3\u30b5\u30fc\u30d0\u30fcIP\u30a2\u30c9\u30ec\u30b9\uff1a192.168.1.100 \u30bb\u30ab\u30f3\u30c9\u30b5\u30fc\u30d0\u30fcIP\u30a2\u30c9\u30ec\u30b9\uff1a1 &hellip; <a href=\"https:\/\/vicsfactory.com\/?p=137\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/vicsfactory.com\/index.php?rest_route=\/wp\/v2\/posts\/137"}],"collection":[{"href":"https:\/\/vicsfactory.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vicsfactory.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vicsfactory.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vicsfactory.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=137"}],"version-history":[{"count":6,"href":"https:\/\/vicsfactory.com\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions"}],"predecessor-version":[{"id":146,"href":"https:\/\/vicsfactory.com\/index.php?rest_route=\/wp\/v2\/posts\/137\/revisions\/146"}],"wp:attachment":[{"href":"https:\/\/vicsfactory.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vicsfactory.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=137"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vicsfactory.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}