{"id":268150,"date":"2023-03-25T14:11:03","date_gmt":"2023-03-25T06:11:03","guid":{"rendered":"https:\/\/gulass.cn\/rdszmsycrzfw.html"},"modified":"2023-03-25T14:11:03","modified_gmt":"2023-03-25T06:11:03","slug":"rdszmsycrzfw","status":"publish","type":"post","link":"https:\/\/gulass.cn\/rdszmsycrzfw.html","title":{"rendered":"rsync\u7684\u56db\u79cd\u6a21\u5f0f\uff08\u8fdc\u7a0b\u5bb9\u707e\u670d\u52a1\u5668\uff09\u5b89\u88c5rsync\u5de5\u5177\u5728\u4ecb\u7ecd"},"content":{"rendered":"

\u5e8f\u8a00<\/p>\n

\u524d\u4e00\u9635\u670d\u52a1\u5668\u5b95\u6389\u4e86linux\u8fd0\u7ef4\u9762\u8bd5\u9898\uff0c\u6240\u4ee5\u6570\u636e\u5907\u4efd\u7684\u91cd\u8981\u6027\u5c31\u663e\u793a\u4e0b\u6765\u4e86\uff0c\u672c\u6587\u5c31\u662f\u5c0f\u7f16\u5728\u7814\u7a76\u670d\u52a1\u5668<\/p>\n

\u6570\u636e\u5907\u4efd\u7684\u7814\u7a76\u6210\u679c\uff0c\u4ec5\u4f9b\u53c2\u8003\u3002<\/p>\n

\u7528\u7684\u5de5\u5177<\/p>\n

\u5c0f\u7f16\u8fd9\u6b21\u7814\u7a76\u7684\u5de5\u5177\u662frsync\uff0crsync\u662fLinux<\/a>\/UNIX\u7cfb\u7edf<\/a>\u4e0b\u7684\u6587\u4ef6\u540c\u6b65\u548c\u6570\u636e\u4f20\u8f93\u5de5\u5177\u3002<\/p>\n

\u5b83\u91c7\u7528\u201crsync\u201d\u7b97\u6cd5\u4f7f\u4e00\u4e2a\u987e\u5ba2\u673a\u548c\u8fdc\u7a0b\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u6587\u4ef6\u540c\u6b65\u3002\u901a\u8fc7rsync\u53ef\u4ee5\u5c06\u540c<\/p>\n

\u4e00\u4e2a\u670d\u52a1\u5668\u7684\u6570\u636e\u4ece\u4e00\u4e2a\u5206\u533a\u5907\u4efd\u5230\u53e6\u4e00\u4e2a\u5206\u533a\u3002\u4e5f\u53ef\u4ee5\u5c06\u672c\u5730\u7cfb\u7edf\u7684\u6570\u636e\u901a\u8fc7\u7f51\u8def\u4f20\u8f93\u65b9<\/p>\n

\u5f0f\u5907\u4efd\u5230\u4efb\u4f55\u4e00\u4e2a\u8fdc\u7a0b\u4e3b\u673a\u4e0a\uff1brsync\u53ef\u4ee5\u5728\u4e2d\u65ad\u4ee5\u540e\u6062\u590d\u4f20\u8f93\uff1b\u4eba\u5c11\u4e5f\u80fd\u4ece\u53ea\u80fd\u4f20\u8f93\u6e90\u6587\u4ef6<\/p>\n

\u548c\u76ee\u6807\u6587\u4ef6\u4e4b\u95f4\u4e0d\u4e00\u6837\u7684\u90e8\u4efd\uff1brsync\u53ef\u4ee5\u6267\u884c\u5b8c\u6574\u5907\u4efd\u6216\u589e\u91cf\u5907\u4efd\u3002<\/p>\n

rsync\u7684\u529f\u80fd\u7279\u70b9<\/p>\n

rsync\u53ef\u4ee5\u955c\u50cf\u4fdd\u5b58\u6574\u4e2a\u76ee\u5f55\u6811\u548c\u6587\u4ef6\u7cfb\u7edf<\/p>\n

rsync\u53ef\u4ee5\u589e\u91cf\u540c\u6b65\u6570\u636elinux \u7cfb\u7edf\u5907\u4efd\u5de5\u5177<\/strong>\uff0c\u6587\u4ef6\u4f20\u8f93\u6548\u7387\u9ad8\uff0c\u56e0\u6b64\u540c\u6b65\u65f6\u95f4\u5f88\u77ed<\/p>\n

\u53ef\u4ee5\u4fdd\u6301\u539f\u6709\u6587\u4ef6\u7684\u6743\u9650\u3001\u65f6\u95f4\u7b49\u5c5e\u6027<\/p>\n

\u52a0\u5bc6\u4f20\u8f93\u6570\u636e\uff0c\u4fdd\u8bc1\u6570\u636e\u7684\u5b89\u5168\u6027\u3002<\/p>\n

rsync\u7684\u56db\u79cd\u6a21\u5f0f<\/p>\n

\u672c\u5730shell\u6a21\u5f0f\uff08\u590d\u5236\u672c\u5730\u6307\u5b9a\u76ee\u5f55\u5230\u53e6\u4e00\u4e2a\u76ee\u5f55\uff09<\/p>\n

\u8fdc\u7a0bshell\u6a21\u5f0f\uff08\u590d\u5236\u672c\u5730\u6307\u5b9a\u76ee\u5f55\u5230\u8fdc\u7a0b\u4e3b\u673a\u76ee\u5f55\uff09<\/p>\n

\u5217\u8868\u6a21\u5f0f\uff08\u67e5\u770b\u672c\u5730\u6216\u8fdc\u7a0b\u4e3b\u673a\u7684\u6307\u5b9a\u76ee\u5f55\uff09<\/p>\n

\u670d\u52a1\u5668\u6a21\u5f0f\uff08\u8fdc\u7a0b\u5bb9\u707e\u670d\u52a1\u5668\u5907\u4efd\uff09<\/p>\n

\u5b89\u88c5rsync\u5de5\u5177<\/p>\n

\u5728\u4ecb\u7ecd\u8fd9\u56db\u79cd\u6a21\u5f0f\u7684\u7528\u6cd5\u4e4b\u524d\uff0c\u6211\u4eec\u987b\u8981\u5148\u5b89\u88c5rsync\u5de5\u5177\uff0c\u5177\u4f53\u6d41\u7a0b\u5982\u4e0b\uff1a<\/p>\n

\u5b89\u88c5\u547d\u4ee4<\/a><\/p>\n

\n

yum -y install rsync<\/code><\/pre>\n<\/p>\n

\u5c0f\u7f16\u8fd9\u513f\u65e9\u5df2\u5b89\u88c5\u597d\u4e86\uff0c\u6240\u4ee5\u76f4\u63a5\u8fdb\u884c\u63a5\u51fa\u6765\u7684\u64cd\u4f5c\uff0c\u542f\u52a8rsync\u670d\u52a1<\/p>\n

\n

rsync --deamon<\/code><\/pre>\n<\/p>\n

\u67e5\u770brsync\u670d\u52a1\u7aef\u53e3\uff08\u9ed8\u8ba4\u4e3a873\uff09<\/p>\n

\n

netstat -tunlp<\/code><\/pre>\n<\/p>\n

\u6b64\u65f6\uff0c\u672c\u5730\u5b89\u88c5\u5c31\u5b8c\u6210\u4e86\uff0c\u63a5\u51fa\u6765\u6211\u4eec\u5f00\u59cb\u4ecb\u7ecd\u7b2c\u4e00\u79cd\u6a21\u5f0f\uff0c\u672c\u5730shell\u6a21\u5f0f\uff08\u590d\u5236\u6307\u5b9a\u76ee\u5f55\u5230\u53e6\u4e00\u4e2a\u76ee\u5f55\uff09<\/p>\n

\u5c0f\u7f16\u5728\u672c\u5730\u865a\u62df\u673a\/tmp\u76ee\u5f55\u4e0b\u521b\u5efa\u4e86test1\u3001test2\u548ctest3\u4e09\u4e2a\u76ee\u5f55\uff0c\u5bf9\u5e94\u76ee\u5f55\u4e0b\u6709<\/p>\n

\u540d\u4e3atest1\u3001test2\u548ctest3\u4e09\u4e2a\u6587\u4ef6\uff0c\u63a5\u51fa\u6765\u6211\u4eec\u6765\u6267\u884c\u672c\u5730\u590d\u5236\u547d\u4ee4<\/p>\n

\n

rsync -av \/tmp\/test2 \/tmp\/test1<\/code><\/pre>\n<\/p>\n

\n

rsync -av \/tmp\/test3\/ \/tmp\/test1<\/code><\/pre>\n<\/p>\n

\u8fd9\u662f\u4e24\u79cd\u672c\u5730\u590d\u5236\u65b9\u6cd5\uff0c\u590d\u5236\u7ed3\u679c\u4e3a<\/p>\n

xp\u7cfb\u7edf\u5de5\u5177\u6ca1\u6709\u5907\u4efd\u9009\u9879_linux \u7cfb\u7edf\u5907\u4efd\u5de5\u5177_linux\u7cfb\u7edf\u600e\u4e48\u5907\u4efd<\/p>\n

\u4e24\u4e2a\u547d\u4ee4\u7684\u5dee\u522b\u662f\u6e90\u53c2\u6570\u672b\u5c3e\u7684\u659c\u6760\uff0c\u5047\u5982\u6e90\u53c2\u6570\u672b\u5c3e\u6ca1\u6709\u659c\u6760\uff0c\u5c31\u5c06\u6307\u5b9a\u7684\u6e90\u76ee\u5f55<\/p>\n

\u590d\u5236\u5230\u6307\u5b9a\u7684\u76ee\u7684\u76ee\u5f55\uff1b\u5047\u5982\u6e90\u53c2\u6570\u672b\u5c3e\u6709\u659c\u6760\uff0c\u5c31\u56de\u590d\u5236\u6307\u5b9a\u6e90\u76ee\u5f55\u4e2d\u7684\u5185\u5bb9\u5230\u76ee<\/p>\n

\u7684\u76ee\u5f55\u4e2d\uff0c\u800c\u4e0d\u590d\u5236\u76ee\u5f55\u672c\u8eab\u3002\u76ee\u6807\u53c2\u6570\u672b\u5c3e\u6709\u6ca1\u6709\u659c\u6760\u662f\u6ca1\u6709\u533a\u522b\u7684\u3002<\/p>\n

\u5176\u4e2d\uff0c\u547d\u4ee4\u4e2d\u201c-a\u201d\u5373\u4e3a\u201c--archive\u201d(\u5f52\u6863\u6a21\u5f0f)\uff0c\u8868\u793a\u4ee5\u9012\u5f52\u5f62\u5f0f\u4f20\u8f93\u6587\u4ef6\uff0c\u5e76\u4fdd<\/p>\n

\u6301\u6240\u6709\u6587\u4ef6\u5c5e\u6027\uff1b\u201c-v\u201d\u5373\u4e3a\u201c--verbose\u201d\uff0c\u8868\u793a\u8f93\u51fa\u8be6\u5c3d\u6a21\u5f0f\u4fe1\u606f\u3002<\/p>\n

\u8fdc\u7a0bshell\u6a21\u5f0f<\/p>\n

\u901a\u8fc7\u8fdc\u7a0bshell\u6a21\u5f0flinux \u7cfb\u7edf\u5907\u4efd\u5de5\u5177<\/strong>\uff0crsync\u53ef\u4ee5\u628a\u672c\u5730\u6307\u5b9a\u76ee\u5f55\u590d\u5236\u5230\u53e6\u4e00\u4e2a\u8fdc\u7a0b\u7cfb\u7edf\u4e2d\uff0c\u5982\u4e0b<\/p>\n

\n

rsync -av \/tmp\/test1 192.168.17.34:\/tmp\/test<\/code><\/pre>\n<\/p>\n

\u6587\u4ef6\u65e9\u5df2\u6210\u529f\u4ece\u672c\u5730\u4f20\u8f93\u5230\u4e86192.1168.17.34\u865a\u62df\u673a\u4e0b\u7684\/tmp\/test\u6587\u4ef6\u5939\u4e0b<\/p>\n

rsync\u5217\u8868\u6a21\u5f0f<\/p>\n

\u5728\u8fd9\u4e2a\u6a21\u5f0f\u4e0blinux \u865a\u62df\u4e3b\u673a\uff0crsync\u5177\u6709\u4e0els\u547d\u4ee4\u76f8\u50cf\u7684\u529f\u80fd\u3002\u8b6c\u5982\uff0c\u7528root\u7528\u6237\u8eab\u5206\u67e5\u770b\u8fdc\u7a0b<\/p>\n

\u4e3b\u673a192.168.17.34\u7684\/tmp\/test\u76ee\u5f55\u4e0b\u7684\u5185\u5bb9\uff1a<\/p>\n

\n

rsync -a 192.168.17.34:\/tmp\/test<\/code><\/pre>\n<\/p>\n

\u67e5\u770b\u672c\u5730\u76ee\u5f55\u53ef\u4ee5\u7528\u5982\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

rsync -a \/tmp\/test1<\/code><\/pre>\n<\/p>\n

linux \u7cfb\u7edf\u5907\u4efd\u5de5\u5177_linux\u7cfb\u7edf\u600e\u4e48\u5907\u4efd_xp\u7cfb\u7edf\u5de5\u5177\u6ca1\u6709\u5907\u4efd\u9009\u9879<\/p>\n

\u670d\u52a1\u5668\u6a21\u5f0f<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5c0f\u7f16\u6b64\u6b21\u7814\u7a76\u7684\u5de5\u5177\u662frsync\uff0crsync\u662fLinux\/UNIX\u7cfb\u7edf\u4e0b\u7684\u6587\u4ef6\u540c\u6b65\u548c\u6570\u636e\u4f20\u8f93\u5de5\u5177\u3002\u5b83\u91c7\u7528\u201crsync\u201d\u7b97\u6cd5\u4f7f\u4e00\u4e2a\u5ba2\u6237\u673a\u548c\u8fdc\u7a0b\u6587\u4ef6\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u6587\u4ef6\u540c\u6b65\u3002\u4e00\u4e2a\u670d\u52a1\u5668\u7684\u6570\u636e\u4ece\u4e00\u4e2a\u5206\u533a\u5907\u4efd\u5230\u53e6\u4e00\u4e2a\u5206\u533a\u3002rsync\u7684\u529f\u80fd\u7279\u6027rsync\u53ef\u4ee5\u955c\u50cf\u4fdd\u5b58\u6574\u4e2a\u76ee\u5f55\u6811\u548c\u6587\u4ef6\u7cfb\u7edf\u8fdc\u7a0bshell\u6a21\u5f0f\uff08\u590d\u5236\u672c\u5730\u6307\u5b9a\u76ee\u5f55\u5230\u8fdc\u7a0b\u4e3b\u673a\u76ee\u5f55\uff09\u670d\u52a1\u5668\u6a21\u5f0f\uff08\u8fdc\u7a0b\u5bb9\u707e\u670d\u52a1\u5668\u5907\u4efd\uff09\u5b89\u88c5rsync\u5de5\u5177<\/p>\n","protected":false},"author":1,"featured_media":268151,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-268150","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/268150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=268150"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/268150\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/268151"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=268150"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=268150"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=268150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}