cpln cp
Overview
Copy files and directories to and from workload containers.
IMPORTANT
The 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:
cpln cp <source-path> <workload-name>:<destination-path> --location <location> --org <org> --gvc <gvc>
Refer to the following examples:
Copy a File
To copy a local file demo-file.txt
to the tmp/
directory in a workload named demo-workload
, run:
cpln cp demo-file.txt demo-workload:tmp/ --location aws-us-west-1 --org demo-org --gvc demo-gvc
Copy a Directory
To copy a local directory demo-directory
to the tmp/
directory in a workload named demo-workload
, run:
cpln cp demo-directory demo-workload:tmp/ --location aws-us-west-1 --org demo-org --gvc demo-gvc
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:
cpln cp <src> <workload-name>:<path>/<new-name> --location aws-us-west-1 --org demo-org --gvc demo-gvc
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:
cpln cp <workload-name>:<source-path> <destination-path> --location <location-name> --org <org> --gvc <gvc>
Refer to the following examples:
Copy a File
To copy the file tmp/demo-file.txt
from a workload named demo-workload
to your local machine, run:
cpln cp demo-workload:tmp/demo-file.txt /path/within/local/machine --location aws-us-west-1 --org demo-org --gvc demo-gvc
Copy a Directory
To copy the directory tmp/demo-directory
from a workload named demo-workload
to your local machine, run:
cpln cp demo-workload:tmp/demo-directory /path/within/local/machine --location aws-us-west-1 --org demo-org --gvc demo-gvc
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:
cpln cp <workload-name>:<path> <src>/<new-name> --location aws-us-west-1 --org demo-org --gvc demo-gvc