Me pehea te Maunga Rclone? Ka whakairihia e Rclone te kopae kapua tiritiri a te roopu a Google mo te tukutahitanga mamao

Me pehea te whakairi i te kopae a te roopu taraiwa a Google ki taku ake tūmau VPS ki te whakatutuki i te kaupapa o te roha kaha me te whakahaere konae?

Me pehea te Maunga Rclone? Ka whakairihia e Rclone te kopae kapua tiritiri a te roopu a Google mo te tukutahitanga mamao

Ko te uaua anake o te tuhinga katoaRcloneWaihanga mamao, he iti ake nga hikoi, engari ehara i te mea uaua me te uaua.

Hei tauira, ko te hunga e hikaka ana, e mataku ana ki te raru e kii ana ka taea e ratou te whakahaere, a ki taku whakapono he maha nga tangata ka taea.

Me pehea te whakauru i te Rclone?

Whakamahia te kōnae hōtuhi whakauru mana ▼

curl https://rclone.org/install.sh | bash

Whakauruhia te whakahau ki te whakamatautau mena kua angitu te whakaurunga ▼

rclone
  • Ko nga korero awhina e whakaatu ana i angitu te whakaurunga.

Me pehea te whirihora i te Rclone?

Kia oti te whakaurunga, timata ki te whirihora ki te taapiri i tetahi maunga hou hei timata▼

rclone config

Me pehea te whiriwhiri i te momo hangahanga Mamao mamao?

Kia kite marama koe, tohua te whiringa mo Google Drive.

Heoi ano, ka rereke pea te maha o nga whiringa i muri i te whakahoutanga o te rclone.

Na te mea e hono ana ki te kōpae kapua a te roopu Google, na reira whiriwhiria te 13 ki konei ▼

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
 1 / 1Fichier
   \ "fichier"
 2 / Alias for an existing remote
   \ "alias"
 3 / Amazon Drive
   \ "amazon cloud drive"
 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, etc)
   \ "s3"
 5 / Backblaze B2
   \ "b2"
 6 / Box
   \ "box"
 7 / Cache a remote
   \ "cache"
 8 / Citrix Sharefile
   \ "sharefile"
 9 / Dropbox
   \ "dropbox"
10 / Encrypt/Decrypt a remote
   \ "crypt"
11 / FTP Connection
   \ "ftp"
12 / Google Cloud Storage (this is not Google Drive)
   \ "google cloud storage"
13 / Google Drive
   \ "drive"
14 / Google Photos
   \ "google photos"
15 / Hubic
   \ "hubic"
16 / In memory object storage system.
   \ "memory"
17 / JottaCloud
   \ "jottacloud"
18 / Koofr
   \ "koofr"
19 / Local Disk
   \ "local"
20 / Mail.ru Cloud
   \ "mailru"
21 / Mega
   \ "mega"
22 / Microsoft Azure Blob Storage
   \ "azureblob"
23 / Microsoft OneDrive
   \ "onedrive"
24 / OpenDrive
   \ "opendrive"
25 / Openstack Swift (Rackspace Cloud Files, Memset Memstore, OVH)
   \ "swift"
26 / Pcloud
   \ "pcloud"
27 / Put.io
   \ "putio"
28 / QingCloud Object Storage
   \ "qingstor"
29 / SSH/SFTP Connection
   \ "sftp"
30 / Sugarsync
   \ "sugarsync"
31 / Transparently chunk/split large files
   \ "chunker"
32 / Union merges the contents of several remotes
   \ "union"
33 / Webdav
   \ "webdav"
34 / Yandex Disk
   \ "yandex"
35 / http Connection
   \ "http"
36 / premiumize.me
   \ "premiumizeme"
Storage> 13 # 选择13,看好是选Google Drive这个选项,rclone更新以后可能选项的数字会有变化
** See help for drive backend at: https://rclone.org/drive/ **

Whakakiia te Id Kiritaki Google me te mea ngaro a te Kiritaki

Ae ra, ki te raru koe, ka taea e koe te pehi tika i te Whakauru ka whakamahi i te Id Kiritaki a RCLONE hei whakaputa i te whirihoranga mamao.

Heoi, he ngoikoretanga tenei, i kii ano nga rangatira o Rclone.

Na te mea he tiketike rawa te reiti whakamahi o ClientId me te Client Secret, he maha nga tangata e whakamahi ana.

He iti noa te nui o te hokohoko a Google ki ia tono a te kiritaki, ka aha ina whakamahia e te roopu tangata i roto i te mano?Whakaarohia mo koe (te nui o te hokohoko 750G ia ra).

  • Na, he pai ake te rehita i te kaihoko a Google a Google Api koe.
  • Me tango noa te hokinga waka, ka taea e koe te whakarereke me te taapiri i muri mai.

Tuatahi me uru koeGoogle API Pokapū Waihangahia he kaupapaTikina he API, tohua "Taupapa Papamahi" mo te momo tono ▼

Tuatahi, me waihanga e koe tētahi kaupapa i roto i te Google API Center, ā, me tiki mai he API; tīpakohia te "Papamahi" hei momo tono.

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> # 回车

E taunaki ana ki te whakarite i to TT kiritaki taupānga Google ▼

Me pehea te whiriwhiri i te mana whakahaere?

Mēnā māu ake e whakamahi, kōwhiria te 1 kia whiwhi whakaaetanga katoa ▼

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 # 选1 回车

Me pehea te tautuhi i te whaiaronga pakiaka?

Kaua e whakamahi i tenei tautuhinga, pehia noa te Enter ▼

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
y/n> n(此处一定要选择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
n) No
y/n> n(此处一定要选择n)

Option config_token.
For this to work, you will need rclone available on a machine that has
a web browser available.
For more help and alternate methods see: https://rclone.org/remote_setup/
Execute the following on the machine with the web browser (same rclone
version recommended):
rclone authorize "drive" "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Then paste the result.
Enter a value.
config_token>

Ko te "config_token" i konei me whiwhi ma te tango me te whakauru i te Rclone ki te rorohiko o te rohe tuatahi▼

Tangohia a Windows hei tauira, haere ki te kōpaki kei reira te rclone.exe i muri i te whakahekenga, tomo cmd ki te pae wāhitau o te kaihōpara ka pehi i te Enter ki te whakatuwhera i te whakahau whakahau i te ara o naianei.

Whakakapihia te whakahau e whai ake neiClient_ID,Client_secret ka mahia ▼

rclone authorize "gdrive" "Client_ID" "Client_secret"
  • (He pai noa tenei tikanga mo te whakaputa whirihoranga mamao me to ake Id Kiritaki)

Ka puta ake he kaitirotiro i muri mai, ka tono kia takiuru koe ki to putea kia whakamanahia.

Me pehea te whakamana i te kaute a Google?

 

Kātahi ka puta ake he matapihi tirotiro, hei akiaki i a koe ki te takiuru ki tō pūkete kia whakamanahia ai. Me pēhea taku whakamana i taku pūkete Google?

  1. Mena kei roto koe i te tuawhenua o Haina, tuatahi me maataki koe i te pakitara X, katahi koe me whai putea Google me te takiuru.
  2. Mena ka puta mai "Kaore ano tenei taupānga i manatokohia e Google", pawhiria te "Arā Atu Anō".
  3. Na, pawhiria Tukua kia whakamanahia.

I muri i te whakamanatanga, ka puta te karere e whai ake nei i te matapihi whakahau whakahau:

If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth
Log in and authorize rclone for access
Waiting for code...
Got code
Paste the following into your remote machine --->
{"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"}
<---End paste
  • {"access_token":"xxxxxxxxxxxxxxxxxx","expiry":"2024-05-15T21:18:39.5036298+08:00"}Ko tenei ihirangi katoa (tae atu ki nga taiapa) ko te tohu, kape me te penapena.
  • Na, whakapirihia te tohu i runga ake nei ka tono mo te whakauru config_token> Te waahi.

Ka whirihorahia e koe a Google Teams ki te tiri i nga kopae kapua?

Na te mea kei te whakamahia te kopae kapua tiritahi a te roopu Google, me whiriwhiriy

Log in and authorize rclone for access
Enter verification code> 4/0AGPbXQ9thkw4XynGuNP91QxL4g9Mz7Rubv7M_lajOCwd8GqHuTlOzI
Configure this as a team drive?
y) Yes
n) No (default)
y/n> y

Me pehea taku whiriwhiri ko tehea Google Teams Shared Drive hei whakairi?

He kōpaki noa a Google Team Shared Drive, ka kiia he kōpaki hei puku kapa.

Na te mea e rua aku kōpae tiima e kiia nei ko CWL-X,

Na, ka kite koe e rua nga whiringa i konei, kotahiwhirihoranga mamaoKotahi anake te kōpae kapa ka taea te here.

Hei nga ra kei te heke mai, ka taea e koe te mahi i etahi atu mamao me te whakairi i enei kopae roopu.

Fetching team drive list...
Choose a number from below, or type in your own value
 1 / CWL-1
 \ "xxxx"
 2 / CWL-2
 \ "xxxx"
Enter a Team Drive ID> # 每个人都不一样,根据自己需求选择要绑定哪一个团队盘

Manatokohia nga korero whirihoranga mamao

Ka mutu, manatokohia nga tawhā o te whirihoranga mamao, ka pato noa y ki te whakaū ▼

--------------------
[CWL-2]
type = drive
client_id = XXX
client_secret = XXX
scope = drive
token = XXX
team_drive = XXX
--------------------
y) Yes this is OK (default)
e) Edit this remote
d) Delete this remote
y/e/d> y

Ka whakaatu i te rarangi o nga romete kua tiakina ki te miihini o naianei, tirohia noa, pehia te q kia puta ▼

Current remotes:

Name                 Type
====                 ====
CWL-2                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
  • I tenei wa, kua oti te whirihoranga Rclone.

I muri i te whirihora o te rorohiko o te rohe, kape tika i nga ihirangi o te konae whirihoranga rclone.conf o te rorohiko rohe kiLinuxKo te kōnae whirihoranga rclone.conf i runga i te tūmau.

I runga i te rorohiko o te rohe me te tūmau, whakauruhia te whakahau e whai ake nei hei tiro i te whakahau tauwāhi kōnae whirihoranga Rclone▼

rclone config file

Uia te konae whirihoranga Rclone, a ko nga hua e whai ake nei▼

rclone config file
Configuration file is stored at:
/root/.config/rclone/rclone.conf
  • Me kape noa nga ihirangi kei roto i te konae whirihoranga rclone.conf o te rorohiko o te rohe ki te konae whirihoranga rclone.conf i runga i te tūmau Linux, a ka taea te whakatau i te raruraru whirihoranga Rclone.

Me pehea taku mahere Google Disks ki nga kōpaki?

Ko te Rclone he taputapu raina whakahau e tautoko ana i te tukutahi, te tuku me te tango raraunga i waenga i nga toa ahanoa rereke me nga puku tukutuku.

Na roto i etahi tautuhinga, ka taea te whakatutuki i nga mahi tino whaihua penei i te tango tuimotu me te taapiri tūmau.

He maha nga huarahi hei whakamahi i te Rclone, a ko te whakapuru tetahi o ratou.

Tuhipoka:Kaore e hiahiatia ana te whakairi.Hei waahanga whakamatautau, he maha nga here me nga take.I muri i te whakapuru, kaore e taea te whakamahi hei kopae tuuturu.I te wa e mahi ana i nga mahi konae, ka whakamahia te kōpae o te rohe mo te keteroki, ara, kei te noho te mokowā kōpae ā-rohe.

Ko te whakamahi hee ka puta he raru penei i te ki tonu o te kōpae me te mau VPS.Ko te rapu mo "Rclone" i runga i a Google, ko te kupu matua e whai kiko ana ko te "whakaeke", he maha nga hoa hou i pohehe.Hei whakapumau i te tuku, te tango, te tukutahi me etahi atu mahi, e taunaki ana kia whakamahia te mahi whakahau taketake a Rclone.

Ko te whakaurunga me whakauru fuse, whiriwhiria te tono whakauru kia rite ki to punaha:

# Debian/Ubantu
apt-get update && apt-get install -y fuse
# CentOS
yum install -y fuse

Maunga Google Drive

Ko te whakapuru i te kōpae whatunga ka wehea ki te whakapuru a-ringa me te whakaoho aunoa, ka taea e koe te whiriwhiri kia rite ki o hiahia ake.

Maunga ā-ringa

#挂载
rclone mount <网盘名称:网盘路径> <本地路径> [参数] --daemon

#取消挂载
fusermount -qzu <本地路径>

Kimihia he waahi pai hei hanga i tetahi kōpaki kau, ka mahi te whakahau mkdir?Kaore koe e hiahia ki te whakaako?

Waihangatia he kōpaki paetata hōu, māu anō te huarahi e whakatau, arā, ko te LocalFolder ▼ e whai ake nei

mkdir /home/gdDisk/

# 挂载为磁盘,下面的DriveName、Folder、LocalFolder参数根据说明自行替换
rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding

# 例如:
rclone mount gdrive:VPS /home/gdDisk \
--no-check-certificate \
--no-gzip-encoding \
--copy-links \
--umask 0000 \
--default-permissions \
--allow-non-empty \
--allow-other \
--transfers 1 \
--buffer-size 64M \
--low-level-retries 200 \
--dir-cache-time 12h \
--vfs-read-chunk-size 32M \
--vfs-read-chunk-size-limit 1G


# 对部分参数解释一下
DriveName:就是之前用rclone创建remote的名称
Folder:自己定,也可以不改。凡是rclone上传的文件都会在该谷歌团队盘的下一个名为“Folder”的文件夹里
LocalFolder:本地的绝对路径 比如 /home/gdDisk

# 如果涉及到读取使用,比如使用H5等在线播放,就在后面多加上以下三条参数
--dir-cache-time 12h
--vfs-read-chunk-size 32M
--vfs-read-chunk-size-limit 1G

# 优化参数
--transfers:该参数是最大同时传输任务数量,如果经常传输大文件,或CPU性能不佳,建议设置为单线程,也就是设置为“1”
--buffer-size:该参数为读取每个文件时的内存缓冲区大小,控制rclone上传和挂载的时候的内存占用
--low-level-retries:该参数为传输文件没速度的时候重试次数,没速度的时候,单个会自动睡眠10ms起,然后再重试
-n = --dry-run - 测试运行,用来查看 rclone 在实际运行中会进行哪些操作。
-P = --progress - 显示实时传输进度,500mS 刷新一次,否则默认 1 分钟刷新一次。
--cache-chunk-size SizeSuffi - 块的大小,默认5M,理论上是越大上传速度越快,同时占用内存也越多。如果设置得太大,可能会导致进程中断。
--cache-chunk-total-size SizeSuffix - 块可以在本地磁盘上占用的总大小,默认10G。
--transfers=N - 并行文件数,默认为4。在比较小的内存的VPS上建议调小这个参数,比如128M的小鸡上使用建议设置为1。
--config string - 指定配置文件路径,string为配置文件路径。
--ignore-errors - 跳过错误。比如 OneDrive 在传了某些特殊文件后会提示Failed to copy: failed to open source object: malwareDetected: Malware detected,这会导致后续的传输任务被终止掉,此时就可以加上这个参数跳过错误。但需要注意 RCLONE 的退出状态码不会为0。

Whai muri i to urunga ki te whakahau maunga ki te tauranga me te pehi i te Enter, he maha nga tangata i whakaaro kua mau ratou.

Ehara i te mea na te mea kei te rere te kaitautai ki mua.

I tenei wa, whakatuwheratia he tauranga, ssh ranei ka uru ki te whakahau kia tirohia mena kua angitu te mapi ▼

df -h

Ka kite koe i te Google Drive i utaina e koe, ko te rahi 1PB ▼

### 文件上传
rclone copy /home/backup gdrive:backup  # 本地路径 配置名字:网盘文件夹路径
### 文件下载
rclone copy gdrive:backup /home/backup  # 配置名字:网盘文件夹路径 本地路径
### 新建文件夹
rclone mkdir gdrive:backup              # 配置名字:网盘文件夹路径
### 获取文件夹大小
rclone size gdrive:backup               # 配置名字:网盘文件夹路径

### 列表
rclone ls gdrive:backup
rclone lsl gdrive:backup # 比上面多一个显示上传时间
rclone lsd gdrive:backup # 只显示文件夹
### 挂载
rclone mount gdrive:mm /root/mm &
### 卸载
fusermount -u  /root/mm

#### 其他 ####
rclone config - 以控制会话的形式添加rclone的配置,配置保存在.rclone.conf文件中。
rclone copy - 将文件从源复制到目的地址,跳过已复制完成的。
rclone sync - 将源数据同步到目的地址,只更新目的地址的数据。   –dry-run标志来检查要复制、删除的数据
rclone move - 将源数据移动到目的地址,如果要在移动后删除空源目录,请加上 --delete-empty-src-d
rclone delete - 删除指定路径下的文件内容。
rclone purge - 清空指定路径下所有文件数据。
rclone mkdir - 创建一个新目录。
rclone rmdir - 删除空目录。
rclone rmdirs - 删除指定灵境下的空目录。如果加上 --leave-root 参数,则不会删除根目录。
rclone check - 检查源和目的地址数据是否匹配。
rclone ls - 列出指定路径下所有的文件以及文件大小和路径。
rclone lsd - 列出指定路径下所有的目录/容器/桶。
rclone lsl - 列出指定路径下所有文件以及修改时间、文件大小和路径。
rclone lsf - 列出指定路径下所有文件和目录
rclone md5sum - 为指定路径下的所有文件产生一个md5sum文件。
rclone sha1sum - 为指定路径下的所有文件产生一个sha1sum文件。
rclone size - 获取指定路径下,文件内容的总大小。.
rclone version - 查看当前版本。
rclone cleanup - 清空remote。
rclone dedupe - 交互式查找重复文件,进行删除/重命名操作。
fusermount -qzu 挂载网盘的文件夹绝对路径 - 取消挂载网盘,不用了以后一定要取消哦。

Me pehea te whakahaere a Rclone Maunga i te kōpae whatunga roopu a Google Cloud i te papamuri?

mount as disk, add&kia rere tonu ki muri ▼

rclone mount DriveName:Folder LocalFolder --copy-links --no-gzip-encoding --no-check-certificate --allow-other --allow-non-empty --umask 000 &
  • Whakamarama:rclone mount Ko te ingoa o te kōpae kapua a te roopu Google i whakakiia e koe i mua: i te kōpae kapatetahi ingoa whaiaronga o naianei /root/Gdrive E tohu ana ki te ara o te raarangi maunga o te rohe katahi ano ka hangaia.--Ko te tikanga mo te maunga, &kei te rere ki muri

kaiwhakahaere

  • Ko nga tikanga ka taea te whakahaere i te papamuri ka mahia.
supervisor
  • He nui, he uaua engari he kaha.

nohup

  • Rapua te whakamahinga o te nphup, puta noa i te tiriti.
nohup
  • Whai muri i te whakahau kia mahia, kia aro ki nga waahi i mua me muri &.

mata

Ko te tikanga, kei te punaha linux tona ake mata. Ki te kore e whakauruhia, whakamahia te whakahau e whai ake nei ▼

sudo apt-get install screen

ranei CentOS whakahau▼

sudo yum install screen

Waihangatia he matapihi hou ko CWL-1 ka mahia te whakahau ki te matapihi ▼

screen -S CWL-1 rclone mount CWL-2:RXFiles /home/ gdDisk/CWL-2 
  • He paihere tawhā kei muri.
  • E taunaki ana kia hanga he konae sh hei whakahaere i te mata, a ka kore tenei toronga e tukuruatia.

Wetetāuta ▼

fusermount-qzu LocalFolder
  • Ko tenei tauirafusermount -qzu /root/Gdrive

Me pehea te tiimata o te rclone i a ia ano?

systemctl

Waihangahia he konae rclone.server hou, ki te punaha Linux:

vim /lib/systemd/system/rclone.service

Tuhia enei e whai ake nei:

#### https://www.chenweiliang.com/cwl-1966.html
[Unit]
Description=rclone

[Service]
User=root
ExecStart=/usr/bin/rclone mount DriveName:RemoteFolder LocalFolder --allow-other --allow-non-empty --vfs-cache-mode writes --config /home/br/.config/rclone/rclone.conf
Restart=on-abort

[Install]
WantedBy=multi-user.target
  • Tuhia te whakarereke i nga uara o DriveName, RemoteFolder me LocalFolder.

Katahi ka utaina ano te daemon kia whai mana te ratonga hou ▼

systemctl daemon-reload 

WhakatuuTuhingapotae

Ka tiimata te rclone i te boot ▼

systemctl enable rclone

timata rclone ▼

systemctl start rclone

tīmata anō rclone ▼

systemctl restart rclone

mutu rclone ▼

systemctl stop rclone

Uiui te mana rclone▼

systemctl status rclone

Opaniraa

He tino watea mo Rclone ki te whakairi i te kopae kapua tiritiri a te roopu a Google, ina koa i runga i te taapiri tukutahi, ka ngawari te tukutahi i nga raraunga o te paetukutuku.

Mena he maha nga roopu a Google e tohatoha ana i nga puku kapua, ka taea hoki e koe te whakamahi i te Rclone ki te kape i nga konae i waenga i a raatau.

  • E tautoko ana a Rclone ki te whakauru i nga kopae whatunga ke.
  • Ka taea hoki te whakamahi i te Maunga SFTP a Rclone hei taputapu taapiri.
  • Mena kei a koe he VPS i te tuawhenua o Haina e hiahia ana koe ki te whakamahi, ka taea e koe te whakamahi i te SFTP, FTP, me te HTTP ki te whakairi me te whakauru i nga rokiroki rereke rereke.

Ka whakamahi a VPS i te Rclone akoranga tukutahi aunoa, tirohia konei ▼

发表 评论

Ka kore e whakaputaina to wahitau imeera. 必填 项 已 用 * Tapanga

Panuku ki te Runga