{"id":351,"date":"2010-08-05T02:38:09","date_gmt":"2010-08-04T17:38:09","guid":{"rendered":"http:\/\/blog.isnext.net\/issy\/?p=351"},"modified":"2010-08-05T02:38:09","modified_gmt":"2010-08-04T17:38:09","slug":"rsync%e3%82%92%e5%88%a9%e7%94%a8%e3%81%97%e3%81%9f%e3%83%87%e3%83%bc%e3%82%bf%e5%90%8c%e6%9c%9f","status":"publish","type":"post","link":"https:\/\/blog.isnext.net\/issy\/archives\/351","title":{"rendered":"rsync\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u540c\u671f"},"content":{"rendered":"<p><strong>\u25a0rsync\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u540c\u671f<\/strong><br \/>\n\u3000\u30b7\u30a7\u30eb\u30a2\u30ab\u30a6\u30f3\u30c8\u7121\u3057\u3067\u30b5\u30fc\u30d0\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u540c\u671f\u66f4\u65b0\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u306e\u4e00\u3064\u3002\u30b5\u30fc\u30d0\u5074\u306fchroot\u3067\u904b\u7528\u3067\u304d\u4efb\u610f\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30c8\u30e9\u30d0\u30fc\u30b9\u3055\u308c\u308b\u3053\u3068\u3082\u306a\u304fftp\u306a\u3069\u3067\u30a2\u30ab\u30a6\u30f3\u30c8\u767a\u884c\u3057\u3066\u904b\u7528\u3092\u884c\u3046\u3088\u308a\u3082\u5b89\u5fc3\u3002rsync\u306fssh\u7d4c\u7531\u3067\u6697\u53f7\u5316\u3082\u53ef\u80fd\u3060\u304c\u3001\u3053\u3053\u3067\u306f\u5272\u611b\u3002<\/p>\n<p>\uff11\uff09\u30b5\u30fc\u30d0\u5074\u306e\u8a2d\u5b9a<br \/>\nrsync\u3092\u30c7\u30fc\u30e2\u30f3\u3068\u3057\u3066\u8d77\u52d5\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\n[code]# vi \/etc\/rsyncd.conf<\/p>\n<p>uid           = root<br \/>\ngid           = wheel<br \/>\nuse chroot    = yes<br \/>\nmax connections = 4<br \/>\nlog file      = \/var\/log\/rsyncd.log<br \/>\npid file      = \/var\/run\/rsyncd.pid<br \/>\ndont compress = *.gz *.tgz *.zip *.pdf *.sit *.sitx *.lzh *.bz2 *.jpg *.gif *.png<\/p>\n<p>[hostdata01]<br \/>\n        comment      = hostdata 01<br \/>\n        hosts allow   = xxx.xxx.xxx.xxx\/32<br \/>\n        hosts deny    = *<br \/>\n        path         = \/var\/www\/host01\/<br \/>\n        auth users   = user01<br \/>\n        secrets file = \/etc\/rsyncd.secrets<br \/>\n        read only    = no<\/p>\n<p>[hostdata02]<br \/>\n        comment      = hostdata 02<br \/>\n        hosts allow   = xxx.xxx.xxx.xxx\/32<br \/>\n        hosts deny    = *<br \/>\n        path         = \/var\/www\/host02\/<br \/>\n        auth users   = user02<br \/>\n        secrets file = \/etc\/rsyncd.secrets<br \/>\n        read only    = no<br \/>\n[\/code]<br \/>\n\u8a8d\u8a3c\u306e\u305f\u3081\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\u30d5\u30a1\u30a4\u30eb\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\n[code]# vi \/etc\/rsyncd.secrets<\/p>\n<p>user01:password01<br \/>\nuser02:password02[\/code]<\/p>\n<p>\u30d1\u30fc\u30df\u30c3\u30b7\u30e7\u30f3\u3092\u5909\u66f4\u3059\u308b<br \/>\n[code]# chmod 0600 \/etc\/rsyncd.secrets[\/code]<\/p>\n<p>\u30c7\u30fc\u30e2\u30f3\u30e2\u30fc\u30c9\u3067\u8d77\u52d5\u3059\u308b\uff08\u3067\u304d\u308b\u3060\u3051port\u306f\u5909\u66f4\u3057\u3066\u304a\u304f\uff09<br \/>\n[code]# rsync &#8211;daemon &#8211;config=\/etc\/rsyncd.conf &#8211;port=10873 [\/code] <\/p>\n<p>iptables\u306e\u8a2d\u5b9a\u3092\u5909\u66f4\u3059\u308b<br \/>\n[code]# vi \/etc\/sysconfig\/iptables<\/p>\n<p>-A RH-Firewall-1-INPUT -m state &#8211;state NEW -m tcp -p tcp &#8211;dport 10873 -j ACCEPT[\/code]<\/p>\n<p>iptables\u3092\u518d\u8d77\u52d5\u3059\u308b<br \/>\n[code]# service iptables restart[\/code]<\/p>\n<p>\uff12\uff09\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306e\u8a2d\u5b9a<br \/>\n[code]# rsync &#8211;port=10873 -avz .\/hostcontens\/ rsync:\/\/user01@serveraddress\/hostdata01\/[\/code]<\/p>\n<p>\u3053\u308c\u3067hostcontents\u4ee5\u4e0b\u306e\u5185\u5bb9\u304c\u30b5\u30fc\u30d0\u306e\/var\/www\/host02\/\u306b\u540c\u671f\u3055\u308c\u308b\u3002<br \/>\n\u5dee\u5206\u66f4\u65b0\u306b\u306a\u308b\u306e\u3067\u4e00\u5ea6\u76ee\u306f\u6642\u9593\u304c\u304b\u304b\u308b\u304c\uff12\u56de\u76ee\u4ee5\u964d\u306f\u77ed\u6642\u9593\u3067\u5b8c\u4e86\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u25a0rsync\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u540c\u671f \u3000\u30b7\u30a7\u30eb\u30a2\u30ab\u30a6\u30f3\u30c8\u7121\u3057\u3067\u30b5\u30fc\u30d0\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u540c\u671f\u66f4\u65b0\u3059\u308b\u305f\u3081\u306e\u624b\u6bb5\u306e\u4e00\u3064\u3002\u30b5\u30fc\u30d0\u5074\u306fchroot\u3067\u904b\u7528\u3067\u304d\u4efb\u610f\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u30c8\u30e9\u30d0\u30fc\u30b9\u3055\u308c\u308b\u3053\u3068\u3082\u306a\u304fftp\u306a\u3069\u3067\u30a2\u30ab\u30a6\u30f3\u30c8\u767a\u884c\u3057\u3066\u904b\u7528 &hellip; <a href=\"https:\/\/blog.isnext.net\/issy\/archives\/351\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;rsync\u3092\u5229\u7528\u3057\u305f\u30c7\u30fc\u30bf\u540c\u671f&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[20,74],"class_list":["post-351","post","type-post","status-publish","format-standard","hentry","category-linux","tag-centos","tag-rsync"],"_links":{"self":[{"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/posts\/351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/comments?post=351"}],"version-history":[{"count":1,"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/posts\/351\/revisions"}],"predecessor-version":[{"id":352,"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/posts\/351\/revisions\/352"}],"wp:attachment":[{"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/media?parent=351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/categories?post=351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.isnext.net\/issy\/wp-json\/wp\/v2\/tags?post=351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}