dnf info rclone
(out) Available Packages
(out) Name : rclone
(out) Version : 1.57.0
(out) Release : 2.el9
(out) Architecture : src
(out) Size : 22 M
(out) Source : None
(out) Repository : epel-source
(out) Summary : Rsync for cloud storage
(out) URL : http://rclone.org/
(out) License : MIT
(out) Description :
(out) : Rclone is a command line program to sync files and directories to
(out) : and from various cloud services.
事前に調べたところ古いバージョンだと Google の認証まわりで不具合があるらしいので、新しいものを使った方が良さそうです。
name> GoogleDrive
Option Storage.
Type of storage to configure.
Choose a number from below, or type in your own value.
1 / 1Fichier
\ (fichier)
2 / Akamai NetStorage
\ (netstorage)
3 / Alias for an existing remote
\ (alias)
4 / Amazon S3 Compliant Storage Providers including AWS, Alibaba, ArvanCloud, Ceph, ChinaMobile, Cloudflare, DigitalOcean, Dreamhost, GCS, HuaweiOBS, IBMCOS, IDrive, IONOS, LyveCloud, Leviia, Liara, Linode, Minio, Netease, Petabox, RackCorp, Rclone, Scaleway, SeaweedFS, StackPath, Storj, Synology, TencentCOS, Wasabi, Qiniu and others
\ (s3)
5 / Backblaze B2
\ (b2)
6 / Better checksums for other remotes
\ (hasher)
7 / Box
\ (box)
8 / Cache a remote
\ (cache)
9 / Citrix Sharefile
\ (sharefile)
10 / Combine several remotes into one
\ (combine)
11 / Compress a remote
\ (compress)
12 / Dropbox
\ (dropbox)
13 / Encrypt/Decrypt a remote
\ (crypt)
14 / Enterprise File Fabric
\ (filefabric)
15 / FTP
\ (ftp)
16 / Google Cloud Storage (this is not Google Drive)
\ (google cloud storage)
17 / Google Drive
\ (drive)
18 / Google Photos
\ (google photos)
19 / HTTP
\ (http)
20 / Hadoop distributed file system
\ (hdfs)
21 / HiDrive
\ (hidrive)
22 / ImageKit.io
\ (imagekit)
23 / In memory object storage system.
\ (memory)
24 / Internet Archive
\ (internetarchive)
25 / Jottacloud
\ (jottacloud)
26 / Koofr, Digi Storage and other Koofr-compatible storage providers
\ (koofr)
27 / Linkbox
\ (linkbox)
28 / Local Disk
\ (local)
29 / Mail.ru Cloud
\ (mailru)
30 / Mega
\ (mega)
31 / Microsoft Azure Blob Storage
\ (azureblob)
32 / Microsoft Azure Files
\ (azurefiles)
33 / Microsoft OneDrive
\ (onedrive)
34 / OpenDrive
\ (opendrive)
35 / OpenStack Swift (Rackspace Cloud Files, Blomp Cloud Storage, Memset Memstore, OVH)
\ (swift)
36 / Oracle Cloud Infrastructure Object Storage
\ (oracleobjectstorage)
37 / Pcloud
\ (pcloud)
38 / PikPak
\ (pikpak)
39 / Proton Drive
\ (protondrive)
40 / Put.io
\ (putio)
41 / QingCloud Object Storage
\ (qingstor)
42 / Quatrix by Maytech
\ (quatrix)
43 / SMB / CIFS
\ (smb)
44 / SSH/SFTP
\ (sftp)
45 / Sia Decentralized Cloud
\ (sia)
46 / Storj Decentralized Cloud Storage
\ (storj)
47 / Sugarsync
\ (sugarsync)
48 / Transparently chunk/split large files
\ (chunker)
49 / Union merges the contents of several upstream fs
\ (union)
50 / Uptobox
\ (uptobox)
51 / WebDAV
\ (webdav)
52 / Yandex Disk
\ (yandex)
53 / Zoho
\ (zoho)
54 / premiumize.me
\ (premiumizeme)
55 / seafile
\ (seafile)
Storage> 17
次に、サービスごとのオプションを指定していきます。
先ほど取得したクライアント ID を貼り付けます。
Option client_id.
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> xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com
同様に、先ほど取得したクライアント シークレットを貼り付けます。
Option client_secret.
OAuth Client Secret.
Leave blank normally.
Enter a string value. Press Enter for the default ("").
client_secret> GOCSPX-XXXXXXXXXXXXXXXXXXXXXXXXXXXX
※ここまで入力したら、Google Cloud 側のダイアログは閉じても大丈夫です。
続いてアクセス権の設定になります。
バックアップファイルを書き込むので、フルアクセス(1)を入力します。
Option scope.
Comma separated list of scopes that rclone should use when requesting access from drive.
Choose a number from below, or type in your own value.
Press Enter to leave empty.
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
Rclone からアクセス可能な Google Drive のフォルダを指定したいので、Advanced config で Yes(y)を応答します。
Option service_account_file.
Service Account Credentials JSON file path.
Leave blank normally.
Needed only if you want use SA instead of interactive login.
Leading `~` will be expanded in the file name as will environment variables such as `${RCLONE_CONFIG_DIR}`.
Enter a value. Press Enter to leave empty.
service_account_file>
Edit advanced config?
y) Yes
n) No (default)
y/n> y
root_folder_id には、前述した Google Drive のフォルダ ID を入力します。
Option token.
OAuth Access Token as a JSON blob.
Enter a value. Press Enter to leave empty.
token>
Option auth_url.
Auth server URL.
Leave blank to use the provider defaults.
Enter a value. Press Enter to leave empty.
auth_url>
Option token_url.
Token server url.
Leave blank to use the provider defaults.
Enter a value. Press Enter to leave empty.
token_url>
Option root_folder_id.
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.
Enter a value. Press Enter to leave empty.
root_folder_id> xxxxxGoogleDriveFolderIDxxxxx
Option auth_owner_only.
Only consider files owned by the authenticated user.
Enter a boolean value (true or false). Press Enter for the default (false).
auth_owner_only>
Option use_trash.
Send files to the trash instead of deleting permanently.
Defaults to true, namely sending files to the trash.
Use `--drive-use-trash=false` to delete files permanently instead.
Enter a boolean value (true or false). Press Enter for the default (true).
use_trash>
Option copy_shortcut_content.
Server side copy contents of shortcuts instead of the shortcut.
When doing server side copies, normally rclone will copy shortcuts as
shortcuts.
If this flag is used then rclone will copy the contents of shortcuts
rather than shortcuts themselves when doing server side copies.
Enter a boolean value (true or false). Press Enter for the default (false).
copy_shortcut_content>
Option skip_gdocs.
Skip google documents in all listings.
If given, gdocs practically become invisible to rclone.
Enter a boolean value (true or false). Press Enter for the default (false).
skip_gdocs>
Option show_all_gdocs.
Show all Google Docs including non-exportable ones in listings.
If you try a server side copy on a Google Form without this flag, you
will get this error:
No export formats found for "application/vnd.google-apps.form"
However adding this flag will allow the form to be server side copied.
Note that rclone doesn't add extensions to the Google Docs file names
in this mode.
Do **not** use this flag when trying to download Google Docs - rclone
will fail to download them.
Enter a boolean value (true or false). Press Enter for the default (false).
show_all_gdocs>
Option skip_checksum_gphotos.
Skip checksums on Google photos and videos only.
Use this if you get checksum errors when transferring Google photos or
videos.
Setting this flag will cause Google photos and videos to return a
blank checksums.
Google photos are identified by being in the "photos" space.
Corrupted checksums are caused by Google modifying the image/video but
not updating the checksum.
Enter a boolean value (true or false). Press Enter for the default (false).
skip_checksum_gphotos>
Option shared_with_me.
Only show files that are shared with me.
Instructs rclone to operate on your "Shared with me" folder (where
Google Drive lets you access the files and folders others have shared
with you).
This works both with the "list" (lsd, lsl, etc.) and the "copy"
commands (copy, sync, etc.), and with all other commands too.
Enter a boolean value (true or false). Press Enter for the default (false).
shared_with_me>
Option trashed_only.
Only show files that are in the trash.
This will show trashed files in their original directory structure.
Enter a boolean value (true or false). Press Enter for the default (false).
trashed_only>
Option starred_only.
Only show files that are starred.
Enter a boolean value (true or false). Press Enter for the default (false).
starred_only>
Option export_formats.
Comma separated list of preferred formats for downloading Google docs.
Enter a string value. Press Enter for the default (docx,xlsx,pptx,svg).
export_formats>
Option import_formats.
Comma separated list of preferred formats for uploading Google docs.
Enter a value. Press Enter to leave empty.
import_formats>
Option allow_import_name_change.
Allow the filetype to change when uploading Google docs.
E.g. file.doc to file.docx. This will confuse sync and reupload every time.
Enter a boolean value (true or false). Press Enter for the default (false).
allow_import_name_change>
Option list_chunk.
Size of listing chunk 100-1000, 0 to disable.
Enter a signed integer. Press Enter for the default (1000).
list_chunk>
Option impersonate.
Impersonate this user when using a service account.
Enter a value. Press Enter to leave empty.
impersonate>
Option upload_cutoff.
Cutoff for switching to chunked upload.
Enter a size with suffix K,M,G,T. Press Enter for the default (8Mi).
upload_cutoff>
Option chunk_size.
Upload chunk size.
Must a power of 2 >= 256k.
Making this larger will improve performance, but note that each chunk
is buffered in memory one per transfer.
Reducing this will reduce memory usage but decrease performance.
Enter a size with suffix K,M,G,T. Press Enter for the default (8Mi).
chunk_size>
Option acknowledge_abuse.
Set to allow files which return cannotDownloadAbusiveFile to be downloaded.
If downloading a file returns the error "This file has been identified
as malware or spam and cannot be downloaded" with the error code
"cannotDownloadAbusiveFile" then supply this flag to rclone to
indicate you acknowledge the risks of downloading the file and rclone
will download it anyway.
Note that if you are using service account it will need Manager
permission (not Content Manager) to for this flag to work. If the SA
does not have the right permission, Google will just ignore the flag.
Enter a boolean value (true or false). Press Enter for the default (false).
acknowledge_abuse>
Option keep_revision_forever.
Keep new head revision of each file forever.
Enter a boolean value (true or false). Press Enter for the default (false).
keep_revision_forever>
Option v2_download_min_size.
If Object's are greater, use drive v2 API to download.
Enter a size with suffix K,M,G,T. Press Enter for the default (off).
v2_download_min_size>
Option pacer_min_sleep.
Minimum time to sleep between API calls.
Enter a duration s,m,h,d,w,M,y. Press Enter for the default (100ms).
pacer_min_sleep>
Option pacer_burst.
Number of API calls to allow without sleeping.
Enter a signed integer. Press Enter for the default (100).
pacer_burst>
Option server_side_across_configs.
Deprecated: use --server-side-across-configs instead.
Allow server-side operations (e.g. copy) to work across different drive configs.
This can be useful if you wish to do a server-side copy between two
different Google drives. Note that this isn't enabled by default
because it isn't easy to tell if it will work between any two
configurations.
Enter a boolean value (true or false). Press Enter for the default (false).
server_side_across_configs>
Option disable_http2.
Disable drive using http2.
There is currently an unsolved issue with the google drive backend and
HTTP/2. HTTP/2 is therefore disabled by default for the drive backend
but can be re-enabled here. When the issue is solved this flag will
be removed.
See: https://github.com/rclone/rclone/issues/3631
Enter a boolean value (true or false). Press Enter for the default (true).
disable_http2>
Option stop_on_upload_limit.
Make upload limit errors be fatal.
At the time of writing it is only possible to upload 750 GiB of data to
Google Drive a day (this is an undocumented limit). When this limit is
reached Google Drive produces a slightly different error message. When
this flag is set it causes these errors to be fatal. These will stop
the in-progress sync.
Note that this detection is relying on error message strings which
Google don't document so it may break in the future.
See: https://github.com/rclone/rclone/issues/3857
Enter a boolean value (true or false). Press Enter for the default (false).
stop_on_upload_limit>
Option stop_on_download_limit.
Make download limit errors be fatal.
At the time of writing it is only possible to download 10 TiB of data from
Google Drive a day (this is an undocumented limit). When this limit is
reached Google Drive produces a slightly different error message. When
this flag is set it causes these errors to be fatal. These will stop
the in-progress sync.
Note that this detection is relying on error message strings which
Google don't document so it may break in the future.
Enter a boolean value (true or false). Press Enter for the default (false).
stop_on_download_limit>
Option skip_shortcuts.
If set skip shortcut files.
Normally rclone dereferences shortcut files making them appear as if
they are the original file (see [the shortcuts section](#shortcuts)).
If this flag is set then rclone will ignore shortcut files completely.
Enter a boolean value (true or false). Press Enter for the default (false).
skip_shortcuts>
Option skip_dangling_shortcuts.
If set skip dangling shortcut files.
If this is set then rclone will not show any dangling shortcuts in listings.
Enter a boolean value (true or false). Press Enter for the default (false).
skip_dangling_shortcuts>
Option resource_key.
Resource key for accessing a link-shared file.
If you need to access files shared with a link like this
https://drive.google.com/drive/folders/XXX?resourcekey=YYY&usp=sharing
Then you will need to use the first part "XXX" as the "root_folder_id"
and the second part "YYY" as the "resource_key" otherwise you will get
404 not found errors when trying to access the directory.
See: https://developers.google.com/drive/api/guides/resource-keys
This resource key requirement only applies to a subset of old files.
Note also that opening the folder once in the web interface (with the
user you've authenticated rclone with) seems to be enough so that the
resource key is not needed.
Enter a value. Press Enter to leave empty.
resource_key>
Option fast_list_bug_fix.
Work around a bug in Google Drive listing.
Normally rclone will work around a bug in Google Drive when using
--fast-list (ListR) where the search "(A in parents) or (B in
parents)" returns nothing sometimes. See #3114, #4289 and
Rclone detects this by finding no items in more than one directory
when listing and retries them as lists of individual directories.
This means that if you have a lot of empty directories rclone will end
up listing them all individually and this can take many more API
calls.
This flag allows the work-around to be disabled. This is **not**
recommended in normal use - only if you have a particular case you are
having trouble with like many empty directories.
Enter a boolean value (true or false). Press Enter for the default (true).
fast_list_bug_fix>
Option metadata_owner.
Control whether owner should be read or written in metadata.
Owner is a standard part of the file metadata so is easy to read. But it
isn't always desirable to set the owner from the metadata.
Note that you can't set the owner on Shared Drives, and that setting
ownership will generate an email to the new owner (this can't be
disabled), and you can't transfer ownership to someone outside your
organization.
Choose a number from below, or type in your own fs.Bits[github.com/rclone/rclone/backend/drive.rwChoices] value.
Press Enter for the default (read).
1 / Do not read or write the value
\ (off)
2 / Read the value only
\ (read)
3 / Write the value only
\ (write)
4 / Read and Write the value.
\ (read,write)
metadata_owner>
Option metadata_permissions.
Control whether permissions should be read or written in metadata.
Reading permissions metadata from files can be done quickly, but it
isn't always desirable to set the permissions from the metadata.
Note that rclone drops any inherited permissions on Shared Drives and
any owner permission on My Drives as these are duplicated in the owner
metadata.
Choose a number from below, or type in your own fs.Bits[github.com/rclone/rclone/backend/drive.rwChoices] value.
Press Enter for the default (off).
1 / Do not read or write the value
\ (off)
2 / Read the value only
\ (read)
3 / Write the value only
\ (write)
4 / Read and Write the value.
\ (read,write)
metadata_permissions>
Option metadata_labels.
Control whether labels should be read or written in metadata.
Reading labels metadata from files takes an extra API transaction and
will slow down listings. It isn't always desirable to set the labels
from the metadata.
The format of labels is documented in the drive API documentation at
-
rclone just provides a JSON dump of this format.
When setting labels, the label and fields must already exist - rclone
will not create them. This means that if you are transferring labels
from two different accounts you will have to create the labels in
advance and use the metadata mapper to translate the IDs between the
two accounts.
Choose a number from below, or type in your own fs.Bits[github.com/rclone/rclone/backend/drive.rwChoices] value.
Press Enter for the default (off).
1 / Do not read or write the value
\ (off)
2 / Read the value only
\ (read)
3 / Write the value only
\ (write)
4 / Read and Write the value.
\ (read,write)
metadata_labels>
Option encoding.
The encoding for the backend.
See the [encoding section in the overview](/overview/#encoding) for more info.
Enter a encoder.MultiEncoder value. Press Enter for the default (InvalidUtf8).
encoding>
Option env_auth.
Get IAM credentials from runtime (environment variables or instance meta data if no env vars).
Only applies if service_account_file and service_account_credentials is blank.
Choose a number from below, or type in your own boolean value (true or false).
Press Enter for the default (false).
1 / Enter credentials in the next step.
\ (false)
2 / Get GCP IAM credentials from the environment (env vars or IAM).
\ (true)
env_auth>
Option description.
Description of the remote
Enter a value. Press Enter to leave empty.
description>
Edit advanced config?
y) Yes
n) No (default)
y/n> n
ブラウザから Google にアクセスして認証を通すのですが、今回設定している VPS はデスクトップ環境が入っていないので No(n)を応答します。
Use web browser to automatically authenticate rclone with remote?
* Say Y if the machine running rclone has a web browser you can use
* Say N if running rclone on a (remote) machine without web browser access
If not sure try Y. If Y failed, try N.
y) Yes (default)
n) No
y/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" "XXXXXX_AUTH_TOKEN_XXXX"
Then paste the result.
Enter a value.
config_token>
Web ブラウザが入っている環境で、同じバージョンの Rclone を実行してトークンを取得する必要があるようです。
Windows 側でリモートセットアップを行う
ここで一旦ターミナルから離れて、Windows 側から認証操作を行います。
Rclone の公式サイトから、同じバージョン(1.66.0)の Windows 版の Zip ファイルをダウンロードして解凍します。
C:\Users\xxxxxx\Desktop\rclone-v1.66.0-windows-amd64\rclone.exe authorize "drive" "XXXXXX_AUTH_TOKEN_XXXX"
(out) NOTICE: Config file "C:\\Users\\xxxxxx\\AppData\\Roaming\\rclone\\rclone.conf" not found - using defaults
(out) NOTICE: Make sure your Redirect URL is set to "http://127.0.0.1:53682/" in your custom config.
(out) NOTICE: If your browser doesn't open automatically go to the following link: http://127.0.0.1:53682/auth?state=xxxxxxxxxxxxxxxxxxxxxx
(out) NOTICE: Log in and authorize rclone for access
(out) NOTICE: Waiting for code...
コメント