Overview
Copy files and directories to and from workload containers.IMPORTANTThe
tar
binary is required to be installed within the workload container image, otherwise, the cpln cp
command will fail.Prerequisites
- CLI installed.
- A running workload in at least one location. Refer to our create a workload guide for additional details.
- Permissions to interact with the workload.
Options
Optional
--location
- The location associated with the workload deployment (e.g.,
aws-us-west-1
). Defaults to the first location fetched from the specified GVC. When specifying, make sure that the specified location is part of the specified GVC.
- The location associated with the workload deployment (e.g.,
--replica
- The replica name associated with the workload deployment. Defaults to the first replica.
--container
- The container name associated with the workload deployment. Defaults to the first container.
--no-preserve
- The copied file/directory’s ownership and permissions will not be preserved in the container. Default:
false
.
- The copied file/directory’s ownership and permissions will not be preserved in the container. Default:
Copy from Local to Workload
To copy a file or directory to a workload, use the following format:Copy a File
To copy a local filedemo-file.txt
to the tmp/
directory in a workload named demo-workload
, run:
Copy a Directory
To copy a local directorydemo-directory
to the tmp/
directory in a workload named demo-workload
, run:
Copy a File or Directory With a New Name
To copy a local file or a directory to a workload and simultaneously change its name, run:Copy from Workload to Local
To copy a file or directory from a workload to a path within the local machine, use the following format:Copy a File
To copy the filetmp/demo-file.txt
from a workload named demo-workload
to your local machine, run:
Copy a Directory
To copy the directorytmp/demo-directory
from a workload named demo-workload
to your local machine, run: