📣
TiDB Cloud Premium はパブリックプレビュー中です。エンタープライズワークロード向けの無制限のスケーリング、即時の弾力性、高度なセキュリティを提供します。このページは自動翻訳されたものです。原文はこちらからご覧ください。

ti fs copy-file



ローカルパス、リモートパス、標準入力、標準出力の間でファイルをコピーします。このコマンドのエイリアスは ti fs cp です。

以下のソースと宛先の組み合わせのうち、いずれか 1 つだけを指定してください。

ソース宛先
--from-local--to-remote
--from-stdin--to-remote
--from-remote--to-local
--from-remote--to-stdout
--from-remote--to-remote

--append は --from-local と --to-remote の組み合わせでのみサポートされます。標準入力またはリモートソースはサポートされません。

構文

ti fs copy-file [--append] [--create-parents] [--description <string>] [--dry-run] [--file-system-id <string>] [--from-local <string>] [--from-remote <string>] [--from-stdin] [--fs-token <string>] [--help] [--layer-id <string>] [--overwrite] [--recursive] [--resume] [--tag <string>] [--to-local <string>] [--to-remote <string>] [--to-stdout] [--version]

オプション

  • --append: ローカルファイルの内容を TiDB Cloud file system 内のファイルに追記します。
  • --create-parents: TiDB Cloud file system からコピーする際に、不足しているローカルの親ディレクトリを作成します。
  • --description <string>: --to-remote 操作のファイル説明です。
  • --dry-run: 変更を適用せずにリクエストを検証します。
  • --file-system-id <string>: ファイルシステムを選択します。TI_FS_FILE_SYSTEM_ID を設定することもできます。
  • --from-local <string>: ローカルのソースパスです。
  • --from-remote <string>: TiDB Cloud file system 内のソースパスです。
  • --from-stdin: 標準入力から読み取り、--to-remote に書き込みます。
  • --fs-token <string>: Filesystem トークンを設定します。省略した場合、コマンドは TI_FS_TOKEN 環境変数を使用します。どちらも指定されていない場合、選択した Filesystem 用にローカルに保存されているトークンを使用します。
  • --help: ヘルプ情報を表示します。
  • --layer-id <string>: コピーした 1 つのファイルを、ベースファイルシステムではなくファイルシステムレイヤーに書き込みます。--recursive とは併用できません。
  • --overwrite: 既存の宛先ファイルを置き換えます。
  • --recursive: ディレクトリ構造を再帰的にコピーします。--layer-id とは併用できません。代わりに、書き込み可能な FUSE マウントを介してレイヤーディレクトリをシードしてください。
  • --resume: 実行中のコピー操作を再開します。
  • --tag <string>: --to-remote 操作用に key=value 形式のタグを作成します。複数回指定できます。
  • --to-local <string>: ローカルの宛先パスです。
  • --to-remote <string>: TiDB Cloud file system 内の宛先パスです。
  • --to-stdout: --from-remote を標準出力に書き込みます。
  • --version: バージョン情報を表示します。

すべてのコマンドで共通のオプションについては、グローバルオプション を参照してください。

例

  • ローカルファイルをアップロードする:

    # Copy a local report into the selected remote Filesystem. ti fs copy-file --file-system-id <file-system-id> --from-local ./report.md --to-remote /reports/report.md
  • リモートファイルをダウンロードする:

    # Create missing local parent directories while downloading the file. ti fs copy-file --file-system-id <file-system-id> --from-remote /reports/report.md --to-local ./downloads/report.md --create-parents
  • リモートディレクトリをコピーする:

    # Duplicate a complete directory tree without downloading it locally. ti fs copy-file --file-system-id <file-system-id> --from-remote /reports --to-remote /archive/reports --recursive
  • 大きなアップロードを再開する:

    # Continue an interrupted local-to-remote transfer instead of restarting it. ti fs copy-file --file-system-id <file-system-id> --from-local ./large.bin --to-remote /artifacts/large.bin --resume
  • リモートログに追記する:

    # Add local log data to the existing remote object efficiently. ti fs copy-file --file-system-id <file-system-id> --from-local ./tail.log --to-remote /logs/app.log --append
  • 標準入力を Filesystem にストリーミングする:

    # Upload generated content without creating an intermediate local file. printf 'ready\n' | ti fs copy-file --file-system-id <file-system-id> --from-stdin --to-remote /status.txt --tag source=stdin --description "generated status"

このページは役に立ちましたか?