rc cp copies files and objects between local paths and S3-compatible remote paths. It is a legacy-compatible command; prefer rc object copy for new scripts.
rc [GLOBAL OPTIONS] cp [OPTIONS] <SOURCE> <TARGET>| Parameter | Description |
|---|---|
SOURCE |
Local file, local directory, or remote object/prefix path. This version accepts one source and one target. |
TARGET |
Local or remote destination path. |
-r, --recursive |
Recursively copy a directory or prefix. |
--overwrite |
Overwrite destination data where supported. |
--dry-run |
Show planned copies without copying data. |
--preserve |
Preserve applicable metadata. |
--content-type |
Set object content type for uploads. |
--storage-class |
Set destination storage class for uploads where supported. |
--enc-s3 <TARGET> |
Apply SSE-S3 to the named remote destination write. |
--enc-kms <TARGET>=<KMS_KEY_ID> |
Apply SSE-KMS to the named remote destination write. |
Upload a file:
rc cp ./report.json local/reports/report.jsonUpload a directory recursively:
rc object copy ./reports/ local/reports/ --recursiveCopy between buckets on the same alias:
rc cp local/reports/summary.json local/archive/summary.jsonUpload with explicit destination encryption:
rc cp ./report.json local/archive/report.json --enc-s3 local/archive/report.jsonRecursively upload a directory and apply one KMS key to the remote target prefix:
rc cp ./reports/ local/archive/ --recursive --enc-kms local/archive/=alias/archive-keyThe last path is the target. Sources can mix local and remote paths only where the command can infer a valid copy direction. S3-to-S3 copies are limited to paths under the same alias in the current implementation; use rc mirror for remote-to-remote synchronization across aliases. Use trailing slashes consistently when copying directory-like prefixes.
Destination encryption flags apply only to remote writes. On rc cp, the selector in --enc-s3 or --enc-kms must match the command destination exactly:
- For a single-object write, use the full remote object path.
- For a recursive upload or remote-to-remote copy, use the same remote prefix passed as
TARGET.
The current implementation supports SSE-S3 and SSE-KMS. It does not support SSE-C, repeated encryption selectors, or MinIO mc-style prefix fan-out matching beyond the exact destination argument for the current command. For shared encryption rules across commands, see Encryption workflows.
Global options shown in command syntax use the same meaning everywhere:
| Option | Description |
|---|---|
--format auto|human|json |
Select automatic, human-readable, or JSON output. |
--json |
Emit JSON output where the command supports structured output. |
--no-color |
Disable terminal colors. |
--no-progress |
Disable progress bars. |
-q, --quiet |
Suppress non-error output. |
--debug |
Enable debug logging. |