使用 Rclone 命令行工具管理对象存储
Last updated
2023-08-16 16:51:08
{"value":"Rclone \u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u6765\u7ba1\u7406\u4e91\u4e0a\u6587\u4ef6\u3002Rclone \u5177\u6709\u5f3a\u5927\u7684\u4e91\u4e0a\u5904\u7406\u529f\u80fd\uff0c\u7b49\u6548\u4e8e unix \u547d\u4ee4 rsync\u3001cp\u3001mv\u3001mount\u3001ls\u3001ncdu\u3001tree\u3001rm \u548c cat\uff0c\u5176\u6700\u521d\u53d7 rsync \u7684\u542f\u53d1\u5e76\u91c7\u7528 Go \u7f16\u5199\u3002\u5f53\u524d\uff0cRclone \u4f5c\u4e3a\u4e00\u4e2a\u6210\u719f\u7684\u5f00\u6e90\u8f6f\u4ef6\uff0c\u5df2\u7ecf\u62e5\u6709\u8f83\u4e3a\u5b8c\u5907\u7684\u6587\u6863\u548c\u793e\u533a\uff0c\u53ef\u4ee5\u63d0\u4f9b\u5e7f\u6cdb\u548c\u53cb\u597d\u7684\u4f7f\u7528\u7528\u4f8b\u3002\n\nRclone \u529f\u80fd\u975e\u5e38\u4e30\u5bcc\u5305\u62ec\u6863\u6848\u540c\u6b65\u3001\u6587\u4ef6\u4f20\u8f93\u3001\u52a0\u5bc6\u3001\u7f13\u5b58\u548c\u6302\u8f7d\u7b49\uff0c\u5e76\u4e14\u652f\u6301\u5404\u5927\u4e91\u5b58\u50a8\u4f9b\u5e94\u5546\u7684\u63a5\u53e3\u3001\u80fd\u63d0\u4f9b\u7edf\u4e00\u7684\u8bbf\u95ee\u754c\u9762\u3002\u4ece v1.60.0 \u5f00\u59cb\uff0cRclone \u53ef\u4ee5\u901a\u8fc7 S3 \u534f\u8bae\u5bf9\u63a5CDNCloud OSS\uff0c\u4ee5\u8fdb\u884c\u5bf9\u8c61\u5b58\u50a8\u7ba1\u7406\uff0c\u5e38\u7528\u529f\u80fd\u5982\uff1a\u4e0a\u4f20\u3001\u4e0b\u8f7d\u3001\u5220\u9664\u3001\u6570\u636e\u8fc1\u79fb\u7b49\u3002\n\n### \u914d\u7f6e Rclone\n\n**\u5173\u4e8e Rclone**\n- **\u00b7**\u67e5\u770b [Rclone](https:\/\/rclone.org\/install\/) \u5b89\u88c5\u5730\u5740\n- **\u00b7**\u70b9\u51fb [Github \u5730\u5740](https:\/\/github.com\/rclone\/rclone) \u67e5\u770b Rclone \u4ee3\u7801\n- **\u00b7**\u67e5\u770b\u66f4\u591a [Rclone \u547d\u4ee4](https:\/\/rclone.org\/commands\/)\n- **\u00b7**\u5176\u4ed6\u8be6\u60c5\u8bf7\u53c2\u8003 [Rclone \u5b98\u65b9\u7f51\u7ad9](https:\/\/rclone.org\/)\n\n*\u6839\u636e\u4e0d\u540c\u673a\u578b\uff0c\u5b89\u88c5\u597d\u5bf9\u5e94\u7684Rclone\u7248\u672c\u540e\uff0c\u5373\u53ef\u5f00\u59cb\u4ee5\u4e0b\u6b65\u9aa4\uff1a\n\n\u4f8b\u5982 \u5728Linux\u7cfb\u7edf\u5b89\u88c5Rclone\uff1a\n\n```\ncurl https:\/\/rclone.org\/install.sh | sudo bash\n```\n\n#### 1\u3001\u521b\u5efa\u65b0\u7684 remote \u7aef\n\n\u5b89\u88c5 Rclone \u540e\uff0c\u6267\u884c rclone config\uff0c\u7136\u540e\u9009\u62e9 n \u521b\u5efa\u65b0\u7684 remote \u7aef\n\n```\nrclone config\nNo remotes found, make a new one?\nn) New remote\ns) Set configuration password\nq) Quit config\nn\/s\/q> n\n\n```\n\n#### 2\u3001\u4e3a remote \u7aef\u547d\u540d\n```\nEnter name for new remote.\nname> CDNCloud #\u6b64\u5904\u81ea\u5b9a\u4e49\u547d\u540d\u5373\u53ef\uff0c\u672c\u6587\u4ee5 \u201cCDNCloud\u201d \u547d\u540d\u4e3a\u4f8b\n```\n\n#### 3\u3001\u9009\u62e9CDNCloud OSS \u6240\u517c\u5bb9\u7684 S3\n\n```\nOption Storage.\nType of storage to configure.\nChoose a number from below, or type in your own value.\n 1 \/ 1Fichier\n \\ (fichier)\n 2 \/ Akamai NetStorage\n \\ (netstorage)\n 3 \/ Alias for an existing remote\n \\ (alias)\n 4 \/ Amazon Drive\n \\ (amazon cloud drive)\n 5 \/ Amazon S3 Compliant Storage Providers including AWS, Alibaba, Ceph, China Mobile, Cloudflare, ArvanCloud, Digital Ocean, Dreamhost, Huawei OBS, IBM COS, IDrive e2, Lyve Cloud, Minio, Netease, RackCorp, Scaleway, SeaweedFS, StackPath, Storj, Tencent COS, Qiniu and Wasabi\n \\ (s3)\n 6 \/ Backblaze B2\n \\ (b2)\n 7 \/ Better checksums for other remotes\n \\ (hasher)\n 8 \/ Box\n \\ (box)\n 9 \/ Cache a remote\n \\ (cache)\n10 \/ Citrix Sharefile\n \\ (sharefile)\n11 \/ Combine several remotes into one\n \\ (combine)\n12 \/ Compress a remote\n \\ (compress)\n13 \/ Dropbox\n \\ (dropbox)\n14 \/ Encrypt\/Decrypt a remote\n \\ (crypt)\n15 \/ Enterprise File Fabric\n \\ (filefabric)\n16 \/ FTP\n \\ (ftp)\n17 \/ Google Cloud Storage (this is not Google Drive)\n \\ (google cloud storage)\n18 \/ Google Drive\n \\ (drive)\n19 \/ Google Photos\n \\ (google photos)\n20 \/ HTTP\n \\ (http)\n21 \/ Hadoop distributed file system\n \\ (hdfs)\n22 \/ HiDrive\n \\ (hidrive)\n23 \/ Hubic\n \\ (hubic)\n24 \/ In memory object storage system.\n \\ (memory)\n25 \/ Internet Archive\n \\ (internetarchive)\n26 \/ Jottacloud\n \\ (jottacloud)\n27 \/ Koofr, Digi Storage and other Koofr-compatible storage providers\n \\ (koofr)\n28 \/ Local Disk\n \\ (local)\n29 \/ Mail.ru Cloud\n \\ (mailru)\n30 \/ Mega\n \\ (mega)\n31 \/ Microsoft Azure Blob Storage\n \\ (azureblob)\n32 \/ Microsoft OneDrive\n \\ (onedrive)\n33 \/ OpenDrive\n \\ (opendrive)\n34 \/ OpenStack Swift (Rackspace Cloud Files, Memset Memstore, OVH)\n \\ (swift)\n35 \/ Pcloud\n \\ (pcloud)\n36 \/ Put.io\n \\ (putio)\n37 \/ QingCloud Object Storage\n \\ (qingstor)\n38 \/ SSH\/SFTP\n \\ (sftp)\n39 \/ Sia Decentralized Cloud\n \\ (sia)\n40 \/ Storj Decentralized Cloud Storage\n \\ (storj)\n41 \/ Sugarsync\n \\ (sugarsync)\n42 \/ Transparently chunk\/split large files\n \\ (chunker)\n43 \/ Union merges the contents of several upstream fs\n \\ (union)\n44 \/ Uptobox\n \\ (uptobox)\n45 \/ WebDAV\n \\ (webdav)\n46 \/ Yandex Disk\n \\ (yandex)\n47 \/ Zoho\n \\ (zoho)\n48 \/ premiumize.me\n \\ (premiumizeme)\n49 \/ seafile\n \\ (seafile)\nStorage> s3\n\n```\n\n#### 4\u3001\u9009\u62e9 Ceph \u4e3a\u540e\u7aef\n```\n\nOption provider.\nChoose your S3 provider.\nChoose a number from below, or type in your own value.\nPress Enter to leave empty.\n 1 \/ Amazon Web Services (AWS) S3\n \\ (AWS)\n 2 \/ Alibaba Cloud Object Storage System (OSS) formerly Aliyun\n \\ (Alibaba)\n 3 \/ Arvan Cloud Object Storage (AOS)\n \\ (ArvanCloud)\n 4 \/ Ceph Object Storage\n \\ (Ceph)\n 5 \/ China Mobile Ecloud Elastic Object Storage (EOS)\n \\ (ChinaMobile)\n 6 \/ Cloudflare R2 Storage\n \\ (Cloudflare)\n 7 \/ DigitalOcean Spaces\n \\ (DigitalOcean)\n 8 \/ Dreamhost DreamObjects\n \\ (Dreamhost)\n 9 \/ Google Cloud Storage\n \\ (GCS)\n10 \/ Huawei Object Storage Service\n \\ (HuaweiOBS)\n11 \/ IBM COS S3\n \\ (IBMCOS)\n12 \/ IDrive e2\n \\ (IDrive)\n13 \/ IONOS Cloud\n \\ (IONOS)\n14 \/ Seagate Lyve Cloud\n \\ (LyveCloud)\n15 \/ Liara Object Storage\n \\ (Liara)\n16 \/ Minio Object Storage\n \\ (Minio)\n17 \/ Netease Object Storage (NOS)\n \\ (Netease)\n18 \/ Petabox Object Storage\n \\ (Petabox)\n19 \/ RackCorp Object Storage\n \\ (RackCorp)\n20 \/ Scaleway Object Storage\n \\ (Scaleway)\n21 \/ SeaweedFS S3\n \\ (SeaweedFS)\n22 \/ StackPath Object Storage\n \\ (StackPath)\n23 \/ Storj (S3 Compatible Gateway)\n \\ (Storj)\n24 \/ Tencent Cloud Object Storage (COS)\n \\ (TencentCOS)\n25 \/ Wasabi Object Storage\n \\ (Wasabi)\n26 \/ Qiniu Object Storage (Kodo)\n \\ (Qiniu)\n27 \/ Any other S3 compatible provider\n \\ (Other)\nprovider> Ceph\n\n\n```\n\n#### 5\u3001\u63d0\u4f9bCDNCloud OSS \u7684 AK\/SK\n\n```\n\nOption env_auth.\nGet AWS credentials from runtime (environment variables or EC2\/ECS meta data if no env vars).\nOnly applies if access_key_id and secret_access_key is blank.\nChoose a number from below, or type in your own boolean value (true or false).\nPress Enter for the default (false).\n 1 \/ Enter AWS credentials in the next step.\n \\ (false)\n 2 \/ Get AWS credentials from the environment (env vars or IAM).\n \\ (true)\nenv_auth> 1\n\n```\n\n\u8f93\u5165CDNCloud OSS \u7684 AK\n\n```\n\nOption access_key_id.\nAWS Access Key ID.\nLeave blank for anonymous access or runtime credentials.\nEnter a value. Press Enter to leave empty.\naccess_key_id> **** AK ****\n\n```\n\n\u8f93\u5165CDNCloud OSS \u7684 SK\n\n```\n\nOption secret_access_key.\nAWS Secret Access Key (password).\nLeave blank for anonymous access or runtime credentials.\nEnter a value. Press Enter to leave empty.\nsecret_access_key> **** SK ****\n\n```\n\n\n#### 6\u3001\u9009\u62e9CDNCloud OSS \u7684 S3 \u5730\u5740\n\n```\n\nOption region.\nRegion to connect to.\nLeave blank if you are using an S3 clone and you don't have a region.\nChoose a number from below, or type in your own value.\nPress Enter to leave empty.\n \/ Use this if unsure.\n 1 | Will use v4 signatures and an empty region.\n \\ ()\n \/ Use this only if v4 signatures don't work.\n 2 | E.g. pre Jewel\/v10 CEPH.\n \\ (other-v2-signature)\nregion> hk\n\n```\n\n```\n\nOption endpoint.\nEndpoint for S3 API.\nRequired when using an S3 clone.\nEnter a value. Press Enter to leave empty.\nendpoint> https:\/\/s3.hk02.1113oss.com #\u586b\u5199\u5bf9\u5e94\u7684Endpoint\uff0c\u672c\u6587\u4ee5 CDNCloud OSS\u9999\u6e2f\u4e8c\u533a \u4e3a\u4f8b\n\n```\n\n```\n\nOption location_constraint.\nLocation constraint - must be set to match the Region.\nLeave blank if not sure. Used when creating buckets only.\nEnter a value. Press Enter to leave empty.\nlocation_constraint> \n\n```\n\n#### 7\u3001 \u9009\u62e9 ACL\n\n```\n\nOption acl.\nCanned ACL used when creating buckets and storing or copying objects.\nThis ACL is used for creating objects and if bucket_acl isn't set, for creating buckets too.\nFor more info visit https:\/\/docs.aws.amazon.com\/AmazonS3\/latest\/dev\/acl-overview.html#canned-acl\nNote that this ACL is applied when server-side copying objects as S3\ndoesn't copy the ACL from the source but rather writes a fresh one.\nIf the acl is an empty string then no X-Amz-Acl: header is added and\nthe default (private) will be used.\nChoose a number from below, or type in your own value.\nPress Enter to leave empty.\n \/ Owner gets FULL_CONTROL.\n 1 | No one else has access rights (default).\n \\ (private)\n \/ Owner gets FULL_CONTROL.\n 2 | The AllUsers group gets READ access.\n \\ (public-read)\n \/ Owner gets FULL_CONTROL.\n 3 | The AllUsers group gets READ and WRITE access.\n | Granting this on a bucket is generally not recommended.\n \\ (public-read-write)\n \/ Owner gets FULL_CONTROL.\n 4 | The AuthenticatedUsers group gets READ access.\n \\ (authenticated-read)\n \/ Object owner gets FULL_CONTROL.\n 5 | Bucket owner gets READ access.\n | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.\n \\ (bucket-owner-read)\n \/ Both the object owner and the bucket owner get FULL_CONTROL over the object.\n 6 | If you specify this canned ACL when creating a bucket, Amazon S3 ignores it.\n \\ (bucket-owner-full-control)\nacl> \n\n```\n\n```\n\nOption server_side_encryption.\nThe server-side encryption algorithm used when storing this object in S3.\nChoose a number from below, or type in your own value.\nPress Enter to leave empty.\n 1 \/ None\n \\ ()\n 2 \/ AES256\n \\ (AES256)\n 3 \/ aws:kms\n \\ (aws:kms)\nserver_side_encryption> \n\n```\n\n```\n\nOption sse_kms_key_id.\nIf using KMS ID you must provide the ARN of Key.\nChoose a number from below, or type in your own value.\nPress Enter to leave empty.\n 1 \/ None\n \\ ()\n 2 \/ arn:aws:kms:*\n \\ (arn:aws:kms:us-east-1:*)\nsse_kms_key_id> \n\n```\n\n#### 8\u3001\u786e\u8ba4\u914d\u7f6e\n\n```\n\nEdit advanced config?\ny) Yes\nn) No (default)\ny\/n> n\n\n```\n\n```\n\nConfiguration complete.\nOptions:\n- type: s3\n- provider: Ceph\n- access_key_id: CUCE5QP3H582SET18RH1\n- secret_access_key: jzjsAqcx8JU5mFltSpIawOla1D0YJyg8mls1J6v5\n- region: hk\n- endpoint: https:\/\/hk03.1113oss.com\nKeep this \"CDNCloud\" remote?\ny) Yes this is OK (default)\ne) Edit this remote\nd) Delete this remote\ny\/e\/d> y\n\n```\n\n```\n\nCurrent remotes:\n\nName Type\n==== ====\nCDNCloud s3\n\ne) Edit existing remote\nn) New remote\nd) Delete remote\nr) Rename remote\nc) Copy remote\ns) Set configuration password\nq) Quit config\ne\/n\/d\/r\/c\/s\/q> q\n\n```\n\n### \u901a\u8fc7 Rclone \u7ba1\u7406CDNCloud OSS \u7684\u5e38\u7528\u547d\u4ee4\n\n#### \u5217\u4e3e\n\n1.\u4ec5\u4ec5\u5217\u4e3e\u5bf9\u8c61\u5b8c\u6574\u8def\u5f84\u548c\u5927\u5c0f\n```\nrclone ls CDNCloud:bucket-name\/directory-path\n```\n\n2.\u989d\u5916\u5217\u4e3e\u5bf9\u8c61\u4fee\u6539\u65f6\u95f4\n```\nrclone lsl CDNCloud:bucket-name\/directory-path\n\n```\n\n3.\u4ec5\u4ec5\u5217\u4e3e\u76ee\u5f55\n```\nrclone lsd CDNCloud:bucket-name\/directory-path\n\n```\n\n4.\u5217\u4e3e\u76ee\u5f55\u548c\u6587\u4ef6\uff0c\u76ee\u5f55\u4ee5 \/ \u7ed3\u5c3e\n```\nrclone lsf CDNCloud:bucket-name\/directory-path\n\n```\n\n5.\u5217\u4e3e\u5bf9\u8c61\u6240\u6709\u4fe1\u606f\uff0c\u4ee5 JSON \u7684\u5f62\u5f0f\n```\nrclone lsjson CDNCloud:bucket-name\/directory-path\n\n```\n\n6.\u4ee5\u6811\u7684\u5f62\u5f0f\u5217\u4e3e\u76ee\u5f55\u548c\u6587\u4ef6\n```\nrclone tree CDNCloud:bucket-name\/directory-path\n\n```\n\n7.\u4ee5 CUI \u7684\u5f62\u5f0f\u5217\u4e3e\u76ee\u5f55\u548c\u6587\u4ef6\n```\nrclone ncdu CDNCloud:bucket-name\/directory-path\n\n```\n\n#### \u8bfb\u53d6\n\n1.\u4ece\u4e91\u5b58\u50a8\u8bfb\u53d6\u5bf9\u8c61\u5185\u5bb9\n```\nrclone cat CDNCloud:dest-bucket-name\/dest-path\n\n```\n2.\u4ece\u4e91\u5b58\u50a8\u83b7\u53d6\u5bf9\u6587\u4ef6\u4e0b\u8f7d\u5730\u5740\n```\nrclone link CDNCloud:dest-bucket-name\/dest-path\n\n```\n3.\u4ece\u4e91\u5b58\u50a8\u76ee\u5f55\u8ba1\u7b97\u5bf9\u8c61\u6570\u91cf\u548c\u603b\u5927\u5c0f\n```\nrclone size CDNCloud:dest-bucket-name\/dest-directory-path\n\n```\n\n#### \u4e0a\u4f20\n\n1.\u4ece\u6807\u51c6\u8f93\u5165\u6d41\u83b7\u53d6\u6570\u636e\u5e76\u4e0a\u4f20\u5230\u4e91\u5b58\u50a8\n```\ncat local-path | rclone rcat CDNCloud:dest-bucket-name\/dest-path\n\n```\n\n#### \u540c\u6b65\n1.\u4ece\u672c\u5730\u540c\u6b65\u5230\u4e91\u5b58\u50a8\n```\nrclone sync local-path CDNCloud:dest-bucket-name\/dest-directory-path\n\n```\n\n2.\u4ece\u4e91\u5b58\u50a8\u540c\u6b65\u5230\u4e91\u5b58\u50a8\n```\nrclone sync CDNCloud:src-bucket-name\/src-directory-path CDNCloud:dest-bucket-name\/dest-directory-path\n\n```\n\n\n3.\u5bf9\u6bd4\u672c\u5730\u4e0e\u4e91\u5b58\u50a8\n```\nrclone check local-path CDNCloud:dest-bucket-name\/dest-directory-path\n\n```\n\n\n4.\u5bf9\u6bd4\u4e91\u5b58\u50a8\u4e0e\u4e91\u5b58\u50a8\n```\nrclone check CDNCloud:src-bucket-name\/src-directory-path CDNCloud:dest-bucket-name\/dest-directory-path\n\n```\n\n#### \u79fb\u52a8\n1.\u79fb\u52a8\u76ee\u5f55\n```\nrclone move CDNCloud:src-bucket-name\/src-directory-path CDNCloud:dest-bucket-name\/dest-directory-path\n\n```\n\n\n2.\u79fb\u52a8\u6587\u4ef6\n```\nrclone moveto CDNCloud:src-bucket-name\/src-path CDNCloud:dest-bucket-name\/dest-path\n\n```\n\n#### \u590d\u5236\n1.\u4ece\u6307\u5b9a URL \u590d\u5236\u5185\u5bb9\u5230\u4e91\u5b58\u50a8\n\n```\nrclone copyurl https:\/\/url CDNCloud:dest-bucket-name\/dest-path\n\n```\n\n2.\u590d\u5236\u76ee\u5f55\n\n```\nrclone copy CDNCloud:src-bucket-name\/src-directory-path CDNCloud:dest-bucket-name\/dest-directory-path\n\n```\n\n3.\u590d\u5236\u6587\u4ef6\n\n```\nrclone copyto CDNCloud:src-bucket-name\/src-path CDNCloud:dest-bucket-name\/dest-path\n\n```\n\n#### \u5220\u9664\n1.\u5220\u9664\u76ee\u5f55\n```\nrclone delete CDNCloud:bucket-name\/dest-directory-path\n\n```\n\n2.\u5220\u9664\u6587\u4ef6\n```\nrclone deletefile CDNCloud:bucket-name\/dest-path\n\n```\n\n#### \u6821\u9a8c\n1.\u6821\u9a8c\u76ee\u5f55\n```\nrclone hashsum MD5 CDNCloud:bucket-name\/dest-directory-path\n\n```\n### \u901a\u8fc7 Rclone \u5bf9\u63a5\u5230CDNCloud OSS \u7684\u5e38\u7528\u547d\u4ee4\n\n1.\u5c06 CDNCloud OSS \u7528\u4f5c HTTP \u670d\u52a1\u5668\n```\nrclone serve http CDNCloud:bucket-name\/dest-directory-path --addr ip:port\n\n```\n\n2.\u5c06 CDNCloud OSS \u7528\u4f5c FTP \u670d\u52a1\u5668\n```\nrclone serve ftp CDNCloud:bucket-name\/dest-directory-path --addr ip:port\n\n```\n\n3.\u5c06 CDNCloud OSS \u4f5c\u4e3a\u6587\u4ef6\u7cfb\u7edf\u6302\u8f7d\u5230\u6302\u8f7d\u70b9\u4e0a\n```\nrclone mount CDNCloud:bucket-name\/dest-directory-path mount-point\n\n```\n\n### \u5728 Linux \u4e0a\u4f7f\u7528 rclone \u6302\u8f7d OSS\uff0c\u5e76\u8bbe\u7f6e\u4e3a\u5f00\u673a\u81ea\u542f\n\n\u5b89\u88c5\u597dRclone\u5e76\u5b8c\u6210\u914d\u7f6e\u540e\uff0c\u5373\u53ef\u5f00\u59cb\u4ee5\u4e0b\u6b65\u9aa4\uff1a\n\n#### 1\u3001\u521b\u5efa\u6302\u8f7d\u76ee\u5f55\n\n```\nmkdir \/home\/guazai #\u672c\u6587\u4ee5 \u201cguazai\u201d \u4e3a\u4f8b\uff0c\u53ef\u81ea\u5b9a\u4e49\u6587\u4ef6\u8def\u5f84\n\n```\n\n#### 2\u3001\u5b89\u88c5fuse3\u63d2\u4ef6\n\n```\nyum install -y fuse3\n```\n\n#### 3\u3001\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\n\n1.\u8fdb\u5165\u6587\u4ef6\u7f16\u8f91\u6a21\u5f0f\n```\nvi \/etc\/fuse.conf\n```\n\n2.\u5220\u6389\u6587\u4ef6\u4e2d user_allow_other \u524d\u9762\u7684\u6ce8\u91ca#\n\n3.\u4fdd\u5b58\u6587\u4ef6\u5e76\u9000\u51fa\n```\n\uff1awq\n```\n\n#### 4\u3001\u6302\u8f7d\n1.\u6302\u8f7d\n```\nrclone mount CDNCloud:pdji4wfd\/hello \/home\/guazai & #\u5176\u4e2d \u201cCDNCloud\u201d\u4f5c\u4e3aremote\u7aef\uff0c \u201cpdji4wfd\u201d\u4f5c\u4e3a\u7a7a\u95f4\u7f16\u53f7\uff0c\u201chello\u201d\u4f5c\u4e3a\u7a7a\u95f4\u5185\u7684\u6587\u4ef6\u5939\uff0c\u201c\/home\/guazai\u201d\u4f5c\u4e3a\u6587\u4ef6\u8def\u5f84\n```\n\n2.\u67e5\u8be2\u662f\u5426\u6302\u8f7d\u6210\u529f\n```\ndf -Th\n```\n\n![](https:\/\/tp2lravq.hk03.1112oss.com\/20230816140632bc9sdli2q4psqiinnm7bnhgmbdfjdaqb.png)\n\n#### 5\u3001\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\n\n1.\u65b0\u5efa\u4e00\u4e2arclone.server\u6587\u4ef6\uff0c\u5e76\u7f16\u8f91\u5185\u5bb9\n\ncentos\uff1a\n```\nvim \/lib\/systemd\/system\/rclone.service\n```\n\nUbuntu\uff1a\n```\nnano \/etc\/systemd\/system\/rclone.service\n```\n\n\u5199\u5165\u4ee5\u4e0b\u5185\u5bb9\uff1a\n```\n[Unit]\nDescription=rclone\n\n[Service]\nUser=root\nExecStart=\/usr\/bin\/rclone mount CDNCloud:pdji4wfd\/hello \/home\/guazai # \u8fd9\u91cc\u9700\u8981\u5199\u7edd\u5bf9\u8def\u5f84\nRestart=on-abort\n\n[Install]\nWantedBy=multi-user.target\n```\n\n2.\u4e3a\u786e\u4fdd\u914d\u7f6e\u751f\u6548\uff0c\u91cd\u8f7d\u914d\u7f6e\u6587\u4ef6\n\n```\nsystemctl daemon-reload\n```\n\n3.\u542f\u52a8rclone\n```\nsystemctl start rclone\n```\n\n4.\u8bbe\u7f6erclone\u5f00\u673a\u542f\u52a8\n```\nsystemctl enable rclone\n```\n\n#### \u5176\u4ed6\u547d\u4ee4\n1.\u91cd\u542frclone\n```\nsystemctl restart rclone\n```\n\n2.\u505c\u6b62rclone\n```\nsystemctl stop rclone\n```\n\n3.\u67e5\u8be2rclone\u72b6\u6001\n\n```\nsystemctl status rclone\n```\n\n4.\u53d6\u6d88\u6302\u8f7d\n\n```\nfusermount -qzu \/home\/guazai\n```"}