CentOS 7
安装
1 |
curl https://rclone.org/install.sh | sudo bash |
安装Fuse
1 |
yum install -y fuse |
建立文件夹在服务器上。这个就是你即将要挂载硬盘的位置。
1 |
mkdir /root/GD |
配置过程
1 |
rclone config |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
[root@centos ~]# rclone config 2020/07/15 09:31:32 NOTICE: Config file "/root/.config/rclone/rclone.conf" not found - using defaults No remotes found - make a new one n) New remote s) Set configuration password q) Quit config n/s/q> n name> GD Type of storage to configure. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 13 / Google Drive \ "drive" 会有变化这里选13 Storage> 13 ** See help for drive backend at: https://rclone.org/drive/ ** Google Application Client Id Setting your own is recommended. See https://rclone.org/drive/#making-your-own-client-id for how to create your own. If you leave this blank, it will use an internal key which is low performance. Enter a string value. Press Enter for the default (""). client_id> Google Application Client Secret Setting your own is recommended. Enter a string value. Press Enter for the default (""). client_secret> Scope that rclone should use when requesting access from drive. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value 1 / Full access all files, excluding Application Data Folder. \ "drive" 2 / Read-only access to file metadata and file contents. \ "drive.readonly" / Access to files created by rclone only. 3 | These are visible in the drive website. | File authorization is revoked when the user deauthorizes the app. \ "drive.file" / Allows read and write access to the Application Data folder. 4 | This is not visible in the drive website. \ "drive.appfolder" / Allows read-only access to file metadata but 5 | does not allow any access to read or download file content. \ "drive.metadata.readonly" scope> 1 ID of the root folder Leave blank normally. Fill in to access "Computers" folders (see docs), or for rclone to use a non root folder as its starting point. Note that if this is blank, the first time rclone runs it will fill it in with the ID of the root folder. Enter a string value. Press Enter for the default (""). root_folder_id> Service Account Credentials JSON file path Leave blank normally. Needed only if you want use SA instead of interactive login. Enter a string value. Press Enter for the default (""). service_account_file> Edit advanced config? (y/n) y) Yes n) No (default) y/n> Remote config Use auto config? * Say Y if not sure * Say N if you are working on a remote or headless machine y) Yes (default) n) No y/n> n 一定选no才能出来链接 Please go to the following link: https://accounts.go。。。。。。。。。。。。。。。。 Log in and authorize rclone for access Enter verification code> Enter verification code> 填写你的码 Configure this as a team drive? y) Yes n) No (default) y/n> y 选择teamdrive Fetching team drive list... Choose a number from below, or type in your own value 1 / 粘包米公开网盘 \ "0111ui4Kp319PVA111" 2 / 1111111 \1k9PVA"111111 Enter a Team Drive ID> 2 -------------------- [GD] type = drive scope = drive token = {"access_token":"ya29.a0AfH6SMAPory0JF2k1c_IZBOficFII6NDK7IOse4Z9TQcFoHyLg2Lla-5VH67zSqH9A4ckY181OzHd0ySJN1kGI1Mm0CQEnpJAxwp1lfprXAcvNo9Hm1Vk4ANf7-mwaUVldf_HQ_DZX7EBstox2NZetAlRqUXrNaRZN0","token_type":"Bearer","refresh_token":"1//09W81O_DP6P0sCgYIARAAGAkSNwF-L9IrxipLQ-9ZDODw_ffsvo3LMT9FQn999pJbJ1DXGkC1wJj9Fyf4BfNdDmFSXY0iREPS5Vg","expiry":"2020-07-15T10:32:53.07755443+08:00"} team_drive = 0ALhs5w6bnZlkUk9PVA -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y Current remotes: Name Type ==== ==== GD drive e) Edit existing remote n) New remote d) Delete remote r) Rename remote c) Copy remote s) Set configuration password q) Quit config e/n/d/r/c/s/q> q |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
cat > /etc/systemd/system/rclone.service <<EOF [Unit] Description=Rclone After=network-online.target [Service] Type=simple ExecStart=/usr/bin/rclone mount GD: /var/lib/transmission/GD \ --umask 0000 \ --default-permissions \ --allow-non-empty \ --allow-other \ --transfers 4 \ --buffer-size 32M \ --low-level-retries 200 Restart=on-abort User=root [Install] WantedBy=default.target EOF |
13.4、重载 daemon,让新的服务文件生效:
1 |
systemctl daemon-reload |
13.5、现在就可以用systemctl来启动rclone了:
1 |
systemctl start rclonegp |
13.6、设置开机启动:
1 |
systemctl enable rclonegp |
14、停止、查看状态可以用:
1 2 |
systemctl stop rclonegp systemctl status rclonegp |
15、重启你的 VPS,然后查看一下 rclone 的服务起来没,接着查看一下盘子挂上去没:
1 2 3 |
reboot systemctl status rclonegp df -h |
16、到这里就完成了