{"id":313201,"date":"2021-01-17T17:46:57","date_gmt":"2021-01-17T09:46:57","guid":{"rendered":"http:\/\/4563.org\/?p=313201"},"modified":"2021-01-17T17:46:57","modified_gmt":"2021-01-17T09:46:57","slug":"%e6%b1%82%e4%b8%80%e4%b8%aa-linux-%e4%bd%bf%e7%94%a8-rsync-%e8%bf%9c%e7%a8%8b%e5%90%8c%e6%ad%a5%ef%bc%8c%e6%8c%87%e5%ae%9a%e7%ab%af%e5%8f%a3%e7%9a%84%e5%86%99%e6%b3%95","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=313201","title":{"rendered":"\u6c42\u4e00\u4e2a Linux \u4f7f\u7528 rsync \u8fdc\u7a0b\u540c\u6b65\uff0c\u6307\u5b9a\u7aef\u53e3\u7684\u5199\u6cd5"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6c42\u4e00\u4e2a Linux \u4f7f\u7528 rsync \u8fdc\u7a0b\u540c\u6b65\uff0c\u6307\u5b9a\u7aef\u53e3\u7684\u5199\u6cd5               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cryboy007 <\/span>  <span><i><\/i> 3<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<pre><code>\u5f53\u524d\u7684\u5199\u6cd5\u662f\uff0c rsync -vzrtopg --progress -e ssh --delete  [email&#160;protected]\/home\/dockertls.sh \/home\/ \u7531\u4e8e\u6211\u4f7f\u7528\u7684 frc \u7a7f\u900f\uff0c\u5bfc\u81f4\u7aef\u53e3\u4e0d\u662f 22\uff0c\u6539\u5199\u6210\u4e0b\u9762\u8fd9\u6837\uff0c\u8fd8\u662f\u4e0d\u884c rsync -vzrtopg --progress -e ssh -p 5551 --delete  [email&#160;protected]\/home\/dockertls.sh \/home\/ <\/code><\/pre>\n<p>\uff0c\u6c42\u5927\u4f6c\u6559\u6559<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>8<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5158653\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : XiaoxiaoPu <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u628a -e \u540e\u9762\u7684\u53c2\u6570\u7528\u5f15\u53f7\u5305\u8d77\u6765\uff0c\u5982\u4e0b<\/p>\n<p> -e &#8216;ssh -p 5551&#8217;                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5158654\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cryboy007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @XiaoxiaoPu \u8c22\u8c22,\u53ef\u4ee5\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5158655\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cryboy007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             &#8220;`shell<br \/>#!\/usr\/bin\/expect<br \/>set timeout 30<br \/>set password xxxx<br \/>#spawn ssh -l root znsd.top -p 5551<br \/>spawn rsync -vzrtopg &#8211;progress -e &#8216;ssh -p 5551&#8217; [email&#160;protected]:\/home\/dockertls.sh \/home\/<br \/> #&gt;\/dev\/null 2&gt;&amp;1<br \/>expect &#8220;*password*&#8221; {send &#8220;$passwordr&#8221;}<br \/>interact<\/p>\n<p>&#8220;`<br \/>\u73b0\u5728,\u6211\u60f3\u5b9e\u73b0\u81ea\u52a8\u8f93\u5165 ssh \u5bc6\u7801\u9a8c\u8bc1,\u4f46\u662f\u5f53\u6211\u4f7f\u7528 expect \u7684\u65f6\u5019,\u62a5\u8fd9\u4e2a\u9519\u8bef<br \/>Unexpected remote arg: [email&#160;protected]:\/home\/dockertls.sh<br \/>rsync error: syntax or usage error (code 1) at main.c(1343) [sender=3.1.2]<br \/>spawn_id: spawn id exp6 not open<br \/> while executing<br \/>&#8220;interact&#8221;<br \/> (file &#8220;\/home\/xxx.sh&#8221; line 8)<\/p>\n<p>\u8bd5\u8fc7\u4e0d\u81ea\u52a8\u8f93\u5165\u5bc6\u7801,\u662f\u53ef\u4ee5\u7684.                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5158656\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cryboy007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @XiaoxiaoPu \u9ebb\u70e6\u5927\u4f6c\u4e86 \/\u53c8\u6709\u4e00\u4e2a\u5c0f\u95ee\u9898&#8230;                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5158657\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : eason1874 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ssh \u4e0d\u80fd\u4f20\u53c2\u8f93\u5165\u5bc6\u7801\uff0c\u4f46\u53ef\u4ee5\u901a\u8fc7 -i \u6307\u5b9a\u5bc6\u94a5\u6587\u4ef6\u4f4d\u7f6e\u3002\u5982\u679c\u662f\u81ea\u52a8\u5316\u811a\u672c\uff0c\u8003\u8651\u53d6\u6d88\u516c\u94a5\u68c0\u67e5\uff0c\u4e0d\u53d6\u6d88\u7b2c\u4e00\u6b21\u8fde\u63a5\u76ee\u6807\u4e3b\u673a\u4f1a\u8981\u6c42\u786e\u8ba4\u516c\u94a5\u6307\u7eb9\u3002\u6bd4\u5982\uff1a<\/p>\n<p>ssh -p 5551 -i \/my\/key.pem -o StrictHostKeyChecking=no                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5158658\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : internelp <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5982\u679c\u9700\u8981\u957f\u671f\u81ea\u52a8\u540c\u6b65\uff0c\u53ef\u4ee5\u8003\u8651\u542f\u52a8 rsync \u670d\u52a1\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5158659\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cryboy007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @eason1874 \u6211\u8bd5\u8fc7\u5982\u679c\u4e0d\u6307\u5b9a\u7aef\u53e3\u5c31\u6ca1\u6709\u8fd9\u4e2a\u95ee\u9898,\u80fd\u591f\u81ea\u52a8\u8f93\u5165\u5bc6\u7801,\u5230\u65f6\u5019\u8bd5\u8bd5\u79d8\u94a5\u767b\u5f55                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5158660\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : cryboy007 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @internelp \u5230\u65f6\u5019\u7814\u7a76\u4e0b.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6c42\u4e00\u4e2a Linux \u4f7f\u7528 rsyn&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/313201"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=313201"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/313201\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=313201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=313201"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=313201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}