{"id":53207,"date":"2024-10-09T09:14:15","date_gmt":"2024-10-09T01:14:15","guid":{"rendered":"https:\/\/server.hk\/cnblog\/53207\/"},"modified":"2024-10-09T09:14:15","modified_gmt":"2024-10-09T01:14:15","slug":"cwrsync-%e5%af%a6%e7%8f%be%e5%be%9e-linux-%e5%88%b0-windows-%e7%9a%84%e6%95%b8%e6%93%9a%e5%90%8c%e6%ad%a5%e5%82%99%e4%bb%bd","status":"publish","type":"post","link":"https:\/\/server.hk\/cnblog\/53207\/","title":{"rendered":"cwrsync \u5be6\u73fe\u5f9e Linux \u5230 Windows \u7684\u6578\u64da\u540c\u6b65\u5099\u4efd"},"content":{"rendered":"<h1 id=\"cwrsync-%e5%af%a6%e7%8f%be%e5%be%9e-linux-%e5%88%b0-windows-%e7%9a%84%e6%95%b8%e6%93%9a%e5%90%8c%e6%ad%a5%e5%82%99%e4%bb%bd-GxnmjNpaPL\">cwrsync \u5be6\u73fe\u5f9e Linux \u5230 Windows \u7684\u6578\u64da\u540c\u6b65\u5099\u4efd<\/h1>\n<p>\u5728\u7576\u4eca\u6578\u64da\u9a45\u52d5\u7684\u4e16\u754c\u4e2d\uff0c\u6578\u64da\u7684\u5b89\u5168\u6027\u548c\u53ef\u7528\u6027\u81f3\u95dc\u91cd\u8981\u3002\u7121\u8ad6\u662f\u4f01\u696d\u9084\u662f\u500b\u4eba\u7528\u6236\uff0c\u5b9a\u671f\u5099\u4efd\u6578\u64da\u90fd\u662f\u4e00\u9805\u5fc5\u8981\u7684\u4efb\u52d9\u3002\u5c0d\u65bc\u4f7f\u7528 Linux \u548c Windows \u7cfb\u7d71\u7684\u7528\u6236\u4f86\u8aaa\uff0c\u5be6\u73fe\u8de8\u5e73\u53f0\u7684\u6578\u64da\u540c\u6b65\u5099\u4efd\u662f\u4e00\u500b\u6311\u6230\u3002\u672c\u6587\u5c07\u4ecb\u7d39\u5982\u4f55\u4f7f\u7528 cwrsync \u5de5\u5177\u4f86\u5be6\u73fe\u5f9e Linux \u5230 Windows \u7684\u6578\u64da\u540c\u6b65\u5099\u4efd\u3002<\/p>\n<h2 id=\"%e4%bb%80%e9%ba%bc%e6%98%af-cwrsync%ef%bc%9f-GxnmjNpaPL\">\u4ec0\u9ebc\u662f cwrsync\uff1f<\/h2>\n<p>cwrsync \u662f\u4e00\u500b\u57fa\u65bc rsync \u7684\u5de5\u5177\uff0c\u5c08\u70ba Windows \u74b0\u5883\u8a2d\u8a08\u3002rsync \u662f\u4e00\u500b\u5f37\u5927\u7684\u6587\u4ef6\u540c\u6b65\u5de5\u5177\uff0c\u5ee3\u6cdb\u61c9\u7528\u65bc Linux \u7cfb\u7d71\u4e2d\u3002cwrsync \u5c07 rsync \u7684\u529f\u80fd\u5e36\u5165 Windows\uff0c\u4f7f\u5f97\u7528\u6236\u80fd\u5920\u5728 Windows \u74b0\u5883\u4e2d\u8f15\u9b06\u5730\u9032\u884c\u6587\u4ef6\u540c\u6b65\u548c\u5099\u4efd\u3002<\/p>\n<h2 id=\"cwrsync-%e7%9a%84%e5%ae%89%e8%a3%9d-GxnmjNpaPL\">cwrsync \u7684\u5b89\u88dd<\/h2>\n<p>\u8981\u4f7f\u7528 cwrsync\uff0c\u9996\u5148\u9700\u8981\u5728 Windows \u7cfb\u7d71\u4e0a\u5b89\u88dd\u5b83\u3002\u4ee5\u4e0b\u662f\u5b89\u88dd\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li>\u8a2a\u554f <a href=\"https:\/\/www.itefix.net\/cwrsync\" rel=\"nofollow noopener\" target=\"_blank\">cwrsync \u7684\u5b98\u65b9\u7db2\u7ad9<\/a> \u4e0b\u8f09\u5b89\u88dd\u5305\u3002<\/li>\n<li>\u89e3\u58d3\u7e2e\u4e0b\u8f09\u7684\u6587\u4ef6\uff0c\u4e26\u5c07\u5176\u653e\u7f6e\u5728\u5408\u9069\u7684\u76ee\u9304\u4e2d\u3002<\/li>\n<li>\u5c07 cwrsync \u7684\u8def\u5f91\u6dfb\u52a0\u5230\u7cfb\u7d71\u7684\u74b0\u5883\u8b8a\u91cf\u4e2d\uff0c\u4ee5\u4fbf\u5728\u547d\u4ee4\u884c\u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u3002<\/li>\n<\/ol>\n<h2 id=\"%e5%9c%a8-linux-%e4%b8%8a%e8%a8%ad%e7%bd%ae-rsync-GxnmjNpaPL\">\u5728 Linux \u4e0a\u8a2d\u7f6e rsync<\/h2>\n<p>\u5728 Linux \u7cfb\u7d71\u4e0a\uff0crsync \u901a\u5e38\u9810\u88dd\u3002\u5982\u679c\u672a\u5b89\u88dd\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9032\u884c\u5b89\u88dd\uff1a<\/p>\n<pre><code>sudo apt-get install rsync<\/code><\/pre>\n<p>\u5b89\u88dd\u5b8c\u6210\u5f8c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u6aa2\u67e5 rsync \u662f\u5426\u6b63\u5e38\u904b\u884c\uff1a<\/p>\n<pre><code>rsync --version<\/code><\/pre>\n<h2 id=\"%e9%85%8d%e7%bd%ae-ssh-%e4%bb%a5%e4%be%bf%e6%96%bc%e5%ae%89%e5%85%a8%e5%82%b3%e8%bc%b8-GxnmjNpaPL\">\u914d\u7f6e SSH \u4ee5\u4fbf\u65bc\u5b89\u5168\u50b3\u8f38<\/h2>\n<p>\u70ba\u4e86\u5be6\u73fe\u5b89\u5168\u7684\u6578\u64da\u50b3\u8f38\uff0c\u5efa\u8b70\u4f7f\u7528 SSH \u9032\u884c\u52a0\u5bc6\u3002\u9996\u5148\uff0c\u78ba\u4fdd\u5728 Linux \u7cfb\u7d71\u4e0a\u5b89\u88dd\u4e86 OpenSSH \u670d\u52d9\uff1a<\/p>\n<pre><code>sudo apt-get install openssh-server<\/code><\/pre>\n<p>\u7136\u5f8c\u555f\u52d5 SSH \u670d\u52d9\uff1a<\/p>\n<pre><code>sudo systemctl start ssh<\/code><\/pre>\n<h2 id=\"%e4%bd%bf%e7%94%a8-cwrsync-%e9%80%b2%e8%a1%8c%e6%95%b8%e6%93%9a%e5%90%8c%e6%ad%a5-GxnmjNpaPL\">\u4f7f\u7528 cwrsync \u9032\u884c\u6578\u64da\u540c\u6b65<\/h2>\n<p>\u5728 Windows \u4e0a\u5b89\u88dd cwrsync \u5f8c\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5f9e Linux \u7cfb\u7d71\u540c\u6b65\u6587\u4ef6\u5230 Windows \u7cfb\u7d71\uff1a<\/p>\n<pre><code>rsync -avz -e \"ssh\" \/path\/to\/linux\/directory user@windows_ip:\/path\/to\/windows\/directory<\/code><\/pre>\n<p>\u5728\u9019\u88e1\uff0c<code>\/path\/to\/linux\/directory<\/code> \u662f\u8981\u5099\u4efd\u7684 Linux \u76ee\u9304\uff0c<code>user@windows_ip<\/code> \u662f Windows \u7cfb\u7d71\u7684\u7528\u6236\u540d\u548c IP \u5730\u5740\uff0c<code>\/path\/to\/windows\/directory<\/code> \u662f Windows \u4e0a\u7684\u76ee\u6a19\u76ee\u9304\u3002<\/p>\n<h2 id=\"%e5%ae%9a%e6%9c%9f%e5%82%99%e4%bb%bd%e7%9a%84%e8%87%aa%e5%8b%95%e5%8c%96-GxnmjNpaPL\">\u5b9a\u671f\u5099\u4efd\u7684\u81ea\u52d5\u5316<\/h2>\n<p>\u70ba\u4e86\u5be6\u73fe\u5b9a\u671f\u5099\u4efd\uff0c\u53ef\u4ee5\u4f7f\u7528 cron \u4efb\u52d9\u4f86\u81ea\u52d5\u57f7\u884c rsync \u547d\u4ee4\u3002\u5728 Linux \u7cfb\u7d71\u4e0a\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u7de8\u8f2f cron \u4efb\u52d9\uff1a<\/p>\n<pre><code>crontab -e<\/code><\/pre>\n<p>\u7136\u5f8c\u6dfb\u52a0\u4ee5\u4e0b\u884c\u4ee5\u8a2d\u7f6e\u6bcf\u65e5\u5099\u4efd\uff1a<\/p>\n<pre><code>0 2 * * * rsync -avz -e \"ssh\" \/path\/to\/linux\/directory user@windows_ip:\/path\/to\/windows\/directory<\/code><\/pre>\n<p>\u9019\u6a23\uff0c\u6bcf\u5929\u51cc\u6668 2 \u9ede\u5c07\u81ea\u52d5\u57f7\u884c\u5099\u4efd\u4efb\u52d9\u3002<\/p>\n<h2 id=\"%e7%b8%bd%e7%b5%90-GxnmjNpaPL\">\u7e3d\u7d50<\/h2>\n<p>\u4f7f\u7528 cwrsync \u548c rsync \u5de5\u5177\uff0c\u53ef\u4ee5\u8f15\u9b06\u5be6\u73fe\u5f9e Linux \u5230 Windows \u7684\u6578\u64da\u540c\u6b65\u5099\u4efd\u3002\u9019\u4e0d\u50c5\u63d0\u9ad8\u4e86\u6578\u64da\u7684\u5b89\u5168\u6027\uff0c\u9084\u80fd\u78ba\u4fdd\u6578\u64da\u7684\u53ef\u7528\u6027\u3002\u5c0d\u65bc\u9700\u8981\u8de8\u5e73\u53f0\u6578\u64da\u7ba1\u7406\u7684\u7528\u6236\u4f86\u8aaa\uff0c\u9019\u662f\u4e00\u500b\u975e\u5e38\u5be6\u7528\u7684\u89e3\u6c7a\u65b9\u6848\u3002\u5982\u679c\u60a8\u6b63\u5728\u5c0b\u627e\u9ad8\u6548\u7684 <a href=\"https:\/\/server.hk\">VPS<\/a> \u89e3\u6c7a\u65b9\u6848\u4f86\u652f\u6301\u60a8\u7684\u6578\u64da\u5099\u4efd\u9700\u6c42\uff0cServer.HK \u63d0\u4f9b\u4e86\u591a\u7a2e\u9078\u64c7\uff0c\u9069\u5408\u4e0d\u540c\u7684\u696d\u52d9\u9700\u6c42\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f7f\u7528 cwrsync \u5be6\u73fe Linux \u5230 Windows \u7684\u9ad8\u6548\u6578\u64da\u540c\u6b65\u5099\u4efd\uff0c\u7c21\u5316\u6587\u4ef6\u7ba1\u7406\uff0c\u63d0\u5347\u6578\u64da\u5b89\u5168\u6027\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4924],"tags":[],"class_list":["post-53207","post","type-post","status-publish","format-standard","hentry","category-setup-tutorials"],"_links":{"self":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/comments?post=53207"}],"version-history":[{"count":1,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53207\/revisions"}],"predecessor-version":[{"id":53208,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/posts\/53207\/revisions\/53208"}],"wp:attachment":[{"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/media?parent=53207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/categories?post=53207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/server.hk\/cnblog\/wp-json\/wp\/v2\/tags?post=53207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}