{"id":385,"date":"2019-01-21T11:44:32","date_gmt":"2019-01-21T03:44:32","guid":{"rendered":"https:\/\/www.sumju.net\/?p=385"},"modified":"2019-12-20T10:52:01","modified_gmt":"2019-12-20T02:52:01","slug":"%e5%88%a9%e7%94%a8onedrive-%e6%89%a9%e5%ae%b9%e4%bd%a0%e7%9a%84vps-%ef%bc%88rclone%ef%bc%89","status":"publish","type":"post","link":"https:\/\/sumju.net\/?p=385","title":{"rendered":"\u5229\u7528OneDrive \u6269\u5bb9\u4f60\u7684VPS \uff08Rclone\uff09"},"content":{"rendered":"<p>\u89c6\u9891\u6559\u7a0b\uff1a<br \/>\n<a href=\"https:\/\/youtu.be\/rE15Ug6evOM\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/youtu.be\/rE15Ug6evOM<\/a><\/p>\n<p>\u5b89\u88c5Rclone<br \/>\n<code>curl https:\/\/rclone.org\/install.sh | sudo bash<\/code><br \/>\n\u5b89\u88c5rinet<br \/>\n<code>apt-get install rinetd<\/code><br \/>\n\u914d\u7f6erinet<br \/>\n<code>nano \/etc\/rinetd.conf <\/code><br \/>\n\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5982\u4e0b<br \/>\n<code>0.0.0.0 9080 127.0.0.1 53682<\/code><br \/>\n\u91cd\u542frinetd<br \/>\n<code>systemctl restart rinetd<\/code><\/p>\n<p>\u5f00\u59cb\u914d\u7f6eRclone\uff1a<br \/>\n<code>rclone config<\/code><\/p>\n<p>root@raspberrypi:\/OneDrive# rclone config<br \/>\nNo remotes found &#8211; make a new one<br \/>\nn) New remote<br \/>\ns) Set configuration password<br \/>\nq) Quit config<br \/>\nn\/s\/q&gt; n      <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u9009n<\/strong><br \/>\nname&gt; OneDrive <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u81ea\u5b9a\u4e49\u8fd9\u4e2a\u8fde\u63a5\u7684\u540d\u79f0<\/strong><br \/>\nType of storage to configure.<br \/>\nEnter a string value. Press Enter for the default (&#8220;&#8221;).<br \/>\nChoose a number from below, or type in your own value<br \/>\n1 \/ A stackable unification remote, which can appear to merge the contents of several remotes<br \/>\n\\ &#8220;union&#8221;<br \/>\n2 \/ Alias for a existing remote<br \/>\n\\ &#8220;alias&#8221;<br \/>\n3 \/ Amazon Drive<br \/>\n\\ &#8220;amazon cloud drive&#8221;<br \/>\n4 \/ Amazon S3 Compliant Storage Providers (AWS, Ceph, Dreamhost, IBM COS, Minio)<br \/>\n\\ &#8220;s3&#8221;<br \/>\n5 \/ Backblaze B2<br \/>\n\\ &#8220;b2&#8221;<br \/>\n6 \/ Box<br \/>\n\\ &#8220;box&#8221;<br \/>\n7 \/ Cache a remote<br \/>\n\\ &#8220;cache&#8221;<br \/>\n8 \/ Dropbox<br \/>\n\\ &#8220;dropbox&#8221;<br \/>\n9 \/ Encrypt\/Decrypt a remote<br \/>\n\\ &#8220;crypt&#8221;<br \/>\n10 \/ FTP Connection<br \/>\n\\ &#8220;ftp&#8221;<br \/>\n11 \/ Google Cloud Storage (this is not Google Drive)<br \/>\n\\ &#8220;google cloud storage&#8221;<br \/>\n12 \/ Google Drive<br \/>\n\\ &#8220;drive&#8221;<br \/>\n13 \/ Hubic<br \/>\n\\ &#8220;hubic&#8221;<br \/>\n14 \/ JottaCloud<br \/>\n\\ &#8220;jottacloud&#8221;<br \/>\n15 \/ Local Disk<br \/>\n\\ &#8220;local&#8221;<br \/>\n16 \/ Mega<br \/>\n\\ &#8220;mega&#8221;<br \/>\n17 \/ Microsoft Azure Blob Storage<br \/>\n\\ &#8220;azureblob&#8221;<br \/>\n18 \/ Microsoft OneDrive<br \/>\n\\ &#8220;onedrive&#8221;<br \/>\n19 \/ OpenDrive<br \/>\n\\ &#8220;opendrive&#8221;<br \/>\n20 \/ Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)<br \/>\n\\ &#8220;swift&#8221;<br \/>\n21 \/ Pcloud<br \/>\n\\ &#8220;pcloud&#8221;<br \/>\n22 \/ QingCloud Object Storage<br \/>\n\\ &#8220;qingstor&#8221;<br \/>\n23 \/ SSH\/SFTP Connection<br \/>\n\\ &#8220;sftp&#8221;<br \/>\n24 \/ Webdav<br \/>\n\\ &#8220;webdav&#8221;<br \/>\n25 \/ Yandex Disk<br \/>\n\\ &#8220;yandex&#8221;<br \/>\n26 \/ http Connection<br \/>\n\\ &#8220;http&#8221;<br \/>\nStorage&gt; 18 <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u900918 \u8fd9\u4e2a\u662f\u4f60\u8981\u9009\u62e9\u7684\u7f51\u76d8\u7c7b\u578b\uff0c\u8fd9\u91cc18\u662fOneDrive<\/strong><br \/>\n** See help for onedrive backend at: https:\/\/rclone.org\/onedrive\/ **<\/p>\n<p>Microsoft App Client Id<br \/>\nLeave blank normally.<br \/>\nEnter a string value. Press Enter for the default (&#8220;&#8221;).<br \/>\nclient_id&gt; <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u7559\u7a7a<\/strong><br \/>\nMicrosoft App Client Secret<br \/>\nLeave blank normally.<br \/>\nEnter a string value. Press Enter for the default (&#8220;&#8221;).<br \/>\nclient_secret&gt; <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u7559\u7a7a<\/strong><br \/>\nEdit advanced config? (y\/n)<br \/>\ny) Yes<br \/>\nn) No<br \/>\ny\/n&gt; n <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u9009n <\/strong><br \/>\nRemote config<br \/>\nUse auto config?<br \/>\n* Say Y if not sure<br \/>\n* Say N if you are working on a remote or headless machine<br \/>\ny) Yes<br \/>\nn) No<br \/>\ny\/n&gt; y <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u9009y<\/strong><br \/>\nIf your browser doesn&#8217;t open automatically go to the following link: http:\/\/127.0.0.1:53682\/auth<br \/>\nLog in and authorize rclone for access<br \/>\nWaiting for code&#8230;<\/p>\n<p>\u5f53\u51fa\u73b0\u4e0a\u9762\u7684\u5b57\u6837\uff0c\u8bf7\u6253\u5f00\u6d4f\u89c8\u5668\u8bbf\u95ee\u4f60\u7684VPS\u5730\u5740+\u7aef\u53e3\u53f79080\u5b8c\u6210\u6388\u6743<\/p>\n<p>\u4f8b\u5982\uff1ahttp:\/\/111.111.111.111:9080\/auth<\/p>\n<p>\u6839\u636e\u63d0\u793a\u5b8c\u6210\u6388\u6743\u540e\u8df3\u8f6c\u7f51\u5740\u4e3a\u7c7b\u4f3c\u4e0b\u9762\u7684\u6837\u5b50\uff0c\u4f1a\u663e\u793a\u65e0\u6cd5\u6253\u5f00\uff0c\u4fee\u6539\u4e00\u4e0b\u670d\u52a1\u5668\u5730\u5740\u5b8c\u6210\u9a8c\u8bc1\uff1a<\/p>\n<p>\u4fee\u6539\u524d\uff1a<\/p>\n<p>http:\/\/<strong>localhost<\/strong>\/?code=Mb40efd29-46d6-735a-77c9-e0bbubc932ea&amp;state=cbd535805a065efb2507b3d08a46da63<\/p>\n<p>\u4fee\u6539\u540e\uff1a<\/p>\n<p>http:\/\/<strong>111.111.111.111:9080<\/strong>\/?code=Mb40efd29-46d6-735a-77c9-e0bbubc932ea&amp;state=cbd535805a065efb2507b3d08a46da63<\/p>\n<p>\u56de\u8f66\u4f1a\u6709\u4e00\u4e2a\u7f51\u9875\u63d0\u793a\u6210\u529f\uff0c\u518d\u6b21\u56de\u5230SSH\u754c\u9762<\/p>\n<p>Waiting for code&#8230;<br \/>\nGot code<br \/>\nChoose a number from below, or type in an existing value<br \/>\n1 \/ OneDrive Personal or Business<br \/>\n\\ &#8220;onedrive&#8221;<br \/>\n2 \/ Root Sharepoint site<br \/>\n\\ &#8220;sharepoint&#8221;<br \/>\n3 \/ Type in driveID<br \/>\n\\ &#8220;driveid&#8221;<br \/>\n4 \/ Type in SiteID<br \/>\n\\ &#8220;siteid&#8221;<br \/>\n5 \/ Search a Sharepoint site<br \/>\n\\ &#8220;search&#8221;<br \/>\nYour choice&gt; 1 <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u90091<\/strong><br \/>\nFound 1 drives, please select the one you want to use:<br \/>\n0: (personal) id=1043704bc734301f<br \/>\nChose drive to use:&gt; 0 <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u90090<\/strong><br \/>\nFound drive &#8216;root&#8217; of type &#8216;personal&#8217;, URL: https:\/\/onedrive.live.com\/?cid=1043704bc734301f<br \/>\nIs that okay?<br \/>\ny) Yes<br \/>\nn) No<br \/>\ny\/n&gt; y <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u9009y<\/strong><br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n[OneDrive]<br \/>\ntype = onedrive<br \/>\ntoken = {&#8220;access_token&#8221;:&#8221;EwBoA8l6BAAURSN\/FHlDW5xN74t6GzbtsBBeBUYAAQhF4YCEsN8EanOsVcJNddrLt2zp2HjOfIRpv8hVMA2X+1obyFiUDkU\/uL\/MC2QzW3vG6T6H\/5\/l8piyEWNUxQNm+gp2O\/Fo7eS89HSnqTPPAwxPXrbZTzcl7UMNUp0pJ71yXfECvqsOgAacdlJTXH7IYhjjNPwTeRFj8wl+QbLc8B0LSbFctwU2XJbdL5Ug8Nbk6E8NSnnmgzA6SFRcreYozEM4Vt13T+iIAZ7ZueHKQsyj9fGnDupF9zXNPS+i7Cvex+8gvAc0ADdbD3jyB+r0cvDgjFnCJqDe36GEesNnwsFz3du05B1Mhkns9NWacCWQ7oe5EXAi3IbCykCtQwADZgAACCGzFwzm03pOAKg7mpZNqhvXv7tEXV3ih2LKN0DWnKyMh+k4aubGWcVy7n4JREZrYi6\/5hGCt0kBPyMizUo9jri\/U3A7Vha9M5ZlKvoXc3SGaqkt7OGhpGgO+8I1JSUU3LB3YPoZRa1jW8u795DMYynHBj+5AC03asW9jTmexDdnxfl5mwIECxWXrCY2ohUOCGMP0AmHSa\/vBacTjICDmuQuGmNHLLRUPBVVeOHWWGFqIqNAUIulo1L9o2Hiq2MK1\/g9rB6XVfG\/GPov6euJjlRFXZ5RyB2ueF0vald8PMUEp+m4w+V6caD27UsKohAegbNg9SWHCCWlrAid6sABI61NxItARxeEx+bcjc02tNlFzuH4WQGXMRjw+DN3l5KFyIw9Q8ANjcAmFttMIsjlYCT+4aALFamomipt5os7oRiKb+68SUvImGA4x35+l9qbp6EsFRnZWQjVJS\/QW6rOTscM6QhYpdmQ0s++dE0\/fJfCHug\/GHwV1HD1gdpE9+WLdbbddPqMHzriRGdAQ56wngDv3hlQgY43sdbIr01wKc\/Nt+4MR790VpMd22QZEUyBZ8Y6TbjJZ9mmdUTFp7NPY+3PW22J9jLUXscYce\/gO5E1E2gUKDMgwkCQCNRkp1OwKjFVEsuB+2wa\/abCc9AAOv7WaqMzvjOXY82fs\/jTYBeR4n8e3gfeZnNedRKoNLegJ5eKSXy9KqLHKNEUnfLIlzEJ7E9rD8X8S40YsULSX\/mQ9\/OkIPuubvzQd\/c01Jo8iYcQI=&#8221;,&#8221;token_type&#8221;:&#8221;Bearer&#8221;,&#8221;refresh_token&#8221;:&#8221;MCahDvXAP5CsUXpBB2yi5*Avj50kaltpwSk7JO5f*8Km2bygFzULgGBsfxy8qsyMNtTD*vrgGqhfQC1wfaHKQP!A21MlzdblX2EKnC4w43AE4*n9pn!DROqgkugSQkmd9G3oDxz0S9VfCq8IFwcBOEyMCUUfNFNokvbu14vQb6OwGsTYyU*XU!FLmatdRrhLa5jdYFRF2aK10V15H5RcuzN1r!HSzbXisUUQL6YIhn0e3gwTG2yk!m8exbdVqnsrOB6PTGfYEnk4LlO9EEEp6a5TTzd5!2obXSAnvCqi70fHWV6C*6fE*2zOylDboqF7CtF8xbAHceTu2JVwKNUt5eq0Uhw6tJuw2sj7OcQie6BjoanTL0GvuZH2C3JYm2Z0Q5jMPiBrcFGVqWLeSGAGiMEI8Y0P4pDg7I58VGx!QhpRd&#8221;,&#8221;expiry&#8221;:&#8221;2019-01-21T12:00:07.780005378+08:00&#8243;}<br \/>\ndrive_id = 1043704bc734301f<br \/>\ndrive_type = personal<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\ny) Yes this is OK<br \/>\ne) Edit this remote<br \/>\nd) Delete this remote<br \/>\ny\/e\/d&gt; y <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u9009y<\/strong><br \/>\nCurrent remotes:<\/p>\n<p>Name Type<br \/>\n==== ====<br \/>\nOneDrive onedrive<\/p>\n<p>e) Edit existing remote<br \/>\nn) New remote<br \/>\nd) Delete remote<br \/>\nr) Rename remote<br \/>\nc) Copy remote<br \/>\ns) Set configuration password<br \/>\nq) Quit config<br \/>\ne\/n\/d\/r\/c\/s\/q&gt; q <strong>&lt;&#8212;&#8212;&#8212;&#8212; \u9009q\u9000\u51fa\u914d\u7f6e<\/strong><\/p>\n<p>\u81f3\u6b64\u914d\u7f6e\u5b8c\u6210\uff0c\u4e0b\u9762\u628a\u8fd9\u4e2a\u7f51\u76d8\u6302\u8f7d\u4e3a\u672c\u673a\u76ee\u5f55\uff1a<\/p>\n<p>\u672c\u673a\u65b0\u5efa\u4e00\u4e2a\u76ee\u5f55\u4f5c\u4e3a\u6302\u8f7d\u76ee\u5f55 \/OneDrive<\/p>\n<p>OneDrive \u91cc\u65b0\u5efa\u4e00\u4e2a\u76ee\u5f55\u7528\u6765\u6302\u8f7d \u8fd9\u91cc\u7528 Rclone\u4e3a\u4f8b<\/p>\n<p><code>\/usr\/bin\/rclone mount OneDrive:\/Rclone \/OneDrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode minimal &amp;<\/code><\/p>\n<p>\u81f3\u6b64\u60a8\u7684OneDrive\u4e0b\u9762\u7684Rclone\u6587\u4ef6\u5939\u5c31\u6302\u8f7d\u5230\u4f60\u7684VPS \/OneDrive \u76ee\u5f55\u4e0b\u4e86\uff0c\u4f60\u53ef\u4ee5\u50cf\u64cd\u4f5c\u672c\u673a\u76ee\u5f55\u4e00\u6837\u64cd\u4f5c\u8fd9\u4e2a\u76ee\u5f55\u4e86\u3002<\/p>\n<p>\u63a5\u4e0b\u6765\u8bb2\u89e3\u5982\u4f55\u8ba9\u7cfb\u7edf\u91cd\u542f\u540e\u81ea\u52a8\u6302\u8f7d\u8fd9\u4e2a\u76ee\u5f55<\/p>\n<pre class=\"brush:bash;toolbar:false\">nano \/usr\/lib\/systemd\/system\/rclone.service<\/pre>\n<pre class=\"brush:bash;toolbar:false\">\u7c98\u8d34\u4e0b\u9762\u5185\u5bb9 \r\n\r\n[Unit]\r\nDescription=rclone\r\n    \r\n[Service]\r\nUser=root\r\nExecStart=\/usr\/bin\/rclone mount OneDrive:\/Rclone \/OneDrive --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 --vfs-cache-mode minimal &amp;\r\nRestart=on-abort\r\n    \r\n[Install]\r\nWantedBy=multi-user.target\r\n\r\n\r\n\u6267\u884c\u4e0b\u97623\u6761\u547d\u4ee4\u540e\uff0c\u5982\u679c\u6ca1\u6709\u62a5\u9519\uff0c\u606d\u559c\u4f60\u6210\u529f\u4e86!<\/pre>\n<pre class=\"brush:bash;toolbar:false\">systemctl daemon-reload<\/pre>\n<pre class=\"brush:bash;toolbar:false\">systemctl enable rclone\r\n\r\nsystemctl start rclone<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u89c6\u9891\u6559\u7a0b\uff1a https:\/\/youtu.be\/rE15Ug6evOM \u5b89\u88c5Rclone curl h&hellip; <a href=\"https:\/\/sumju.net\/?p=385\" class=\"more-link read-more\" rel=\"bookmark\">\u7ee7\u7eed\u9605\u8bfb <span class=\"screen-reader-text\">\u5229\u7528OneDrive \u6269\u5bb9\u4f60\u7684VPS \uff08Rclone\uff09<\/span><i class=\"fa fa-arrow-right\"><\/i><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[14],"tags":[],"class_list":{"0":"post-385","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-linux","7":"h-entry","9":"h-as-article"},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/385","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=385"}],"version-history":[{"count":11,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions"}],"predecessor-version":[{"id":1486,"href":"https:\/\/sumju.net\/index.php?rest_route=\/wp\/v2\/posts\/385\/revisions\/1486"}],"wp:attachment":[{"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=385"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=385"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sumju.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=385"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}