内容へ移動
fl8 Wiki
ユーザ用ツール
ログイン
サイト用ツール
検索
ツール
文書の表示
以前のリビジョン
バックリンク
最近の変更
メディアマネージャー
サイトマップ
ログイン
>
最近の変更
メディアマネージャー
サイトマップ
現在位置:
Dokuwiki.fl8.jp
»
50 日記
»
2024
»
10
»
2024.10.02 rclone
トレース:
50_dialy:2024:10:02
この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。
====== 2024.10.02 rclone ====== rclone で、s3にフォルダごとアップロードしたり、mountしたりできる ===== rcloneインストール ===== <code> apt install rclone </code> ===== rclone config ===== rcloneのconfigコマンドで、設定ファイルを作成する。 <code> # rclone config n) New remote s) Set configuration password q) Quit config n/s/q> n name> s3 4 / Amazon S3 Compliant Storage Provider (AWS, Alibaba, Ceph, Digital Ocean, Dreamhost, IBM COS, Minio, Tencent COS, etc) \ "s3" Storage> 4 13 / Any other S3 compatible provider \ "Other provider> 13 1 / Enter AWS credentials in the next step \ "false" env_auth> 1 AWS Access Key ID. Leave blank for anonymous access or runtime credentials. Enter a string value. Press Enter for the default (""). access_key_id> fbXXXXXXXXXXXXXX7QF AWS Secret Access Key (password) Leave blank for anonymous access or runtime credentials. Enter a string value. Press Enter for the default (""). secret_access_key> auVaS6XXXXXXXXXXXXXXXXXXXXXXXXXXXXdrH6z region> Endpoint for S3 API. Required when using an S3 clone. Enter a string value. Press Enter for the default (""). Choose a number from below, or type in your own value endpoint> https://s33.kumolabo.com Edit advanced config? (y/n) y) Yes n) No (default) y/n> n [s3] provider = Other env_auth = false access_key_id = fbXXXXXXXXXXXXXX7QF secret_access_key = auVaS6XXXXXXXXXXXXXXXXXXXXXXXXXXXXdrH6z endpoint = https://s3.fl8.com -------------------- y) Yes this is OK (default) e) Edit this remote d) Delete this remote y/e/d> y </code> ==== configファイルの場所 ==== 「~/.config/rclone/rclone.conf 」にファイルができます。 普通に下記を直接作成してもOK <code> # cat ~/.config/rclone/rclone.conf [s3] type = s3 provider = Other env_auth = false access_key_id = fbXXXXXXXXXXXXXX7QF secret_access_key = auVaS6XXXXXXXXXXXXXXXXXXXXXXXXXXXXdrH6z endpoint = https://s3.fl8.com </code> === configファイルを指定 === --configでconfigファイルを指定も可能 <code> rclone --config /path/to/custom/rclone.conf ls s3:mybucket </code> ===== rcloneコマンド ===== ==== ls ==== 対象バケットのファイル一覧を表示 <code> rclone ls s3:mybucket 4 a.txt 4 b.txt 4 c.txt </code> ==== copy ==== <code> rclone copy a.txt s3:mybucket </code> ==== sync ==== ローカルフォルダと、S3側のフォルダと同期させる。 ※もしローカル側でファイル削除されていたら、S3側も削除される。 <code> # tree work/ work/ ├── a.txt ├── b.txt └── c.txt # rclone sync work s3:mybucket/work # rclone ls s3:mybucket 5 work/a.txt 8 work/b.txt 18 work/c.txt # rm work/b.txt # rclone sync work s3:mybucket/work # rclone ls s3:matsui 5 work/a.txt 18 work/c.txt </code> === progress === --progressで進捗を表示 <code> # rclone sync --progress /app/dokuwiki s3:mybucket/dokuwiki Transferred: 48.249M / 161.204 MBytes, 30%, 672.532 kBytes/s, ETA 2m51s Checks: 8205 / 8205, 100% Transferred: 4627 / 14639, 32% Elapsed time: 1m13.6s Transferring: * data/dokuwiki/data/cac…8539742999e855252.feed:100% /2.129k, 0/s, - * data/dokuwiki/data/cac…aaeee960c650ad936378.i:100% /1.263k, 0/s, - * data/dokuwiki/data/cac…0c650ad936378.metadata:100% /10, 0/s, - * data/dokuwiki/data/cac…e960c650ad936378.xhtml:100% /401, 0/s, - </code> ==== mount ==== S3フォルダをローカルにマウントする。 <code> rclone mount s3:mybucket /mnt/ --daemon # df Filesystem 1K-blocks Used Available Use% Mounted on s3:mybucket 1099511627776 0 1099511627776 0% /mnt </code> ==== rclone option ==== [[https://rclone.org/commands/]] {{tag>日記 rclone}}
50_dialy/2024/10/02.txt
· 最終更新: 2024/10/04 00:42 by
matsui
ページ用ツール
文書の表示
以前のリビジョン
バックリンク
文書の先頭へ