rclone Googleドライブ

https://forum.rclone.org/t/qnap-nas-rclone-tutorial-work-in-progress/3225

rclone で google ドライブにデータ転送 #Mac - Qiita 2019

rcloneでGoogleドライブの"共有ドライブ"からLinuxサーバにファイルを移動する - アメリエフの技術ブログ 2021

rclone 1.64.0

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"
Then paste the result.
Enter a value.
config_token>

サーバなど直接Webブラウザを開けない環境の場合、ブラウザを使用できるPC環境などで(同じバージョンの) rcloneで認証をして結果を貼る。

$ rclone authorize "drive"
token削除
  1. ブラウザでGoogleDriveにアクセス、[設定] > [アプリの管理] > [rclone] > [オプション] > [ドライブから切断]
  2. rclone config > d) Delete remote (もしくは ~/.config/rclone/rclone.conf を直接編集)

Google Driveをコマンドラインから扱う(Gdrive使用) #fedora - Qiita 2019

sync

ディレクトリを同期する

rsyncのように、ディレクトリ全体を同期するにはsyncサブコマンドを使います。syncはファイルのサイズ、タイムスタンプ、MD5チェックサムなどを確認し、変更があったファイルだけを転送します。この際、転送元で削除されているファイルはバケット上からも削除されます *1 ので注意してください。rsyncと同じことが言えますが、実際に同期する前に-nオプションと-vオプションを使い、DRY RUNしておくのがよいでしょう。
https://www.infiniteloop.co.jp/tech-blog/2015/07/rsync-for-cloud-storage/

速度

# Performance Flags

Flags helpful for increasing performance.

      --buffer-size SizeSuffix   In memory buffer size when reading files for each --transfer (default 16Mi)
      --checkers int             Number of checkers to run in parallel (default 8)
      --transfers int            Number of file transfers to run in parallel (default 4)

https://forum.rclone.org/t/beginner-fastes-way-to-upload-to-gdrive-large-files/15791/2

フラグ	タイプ	説明
--checkers	int	並行して実行されるチェッカーの数 (デフォルトは 8)。 これは実行されるチェックサム比較スレッドの数です。 この値は、64 以上にすることをお勧めします。
--transfers	int	これは並行して転送されるオブジェクトの数です (デフォルトは 4)。 多数の小さいファイルを転送する場合、この値は、64、128、またはそれ以上にすることをお勧めします。

https://cloud.ibm.com/docs/cloud-object-storage?topic=cloud-object-storage-region-copy&locale=ja

*1:rsync –deleteと似た挙動です。