> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# vastai cloud copy

Copy files/folders to and from cloud providers

## Usage

```bash theme={null}
vastai cloud copy --src SRC --dst DST --instance INSTANCE_ID -connection CONNECTION_ID --transfer TRANSFER_TYPE
```

## Options

<ParamField path="--src" type="string">
  path to source of object to copy
</ParamField>

<ParamField path="--dst" type="string" default="/workspace">
  path to target of copy operation
</ParamField>

<ParamField path="--instance" type="string">
  id of the instance
</ParamField>

<ParamField path="--connection" type="string">
  id of cloud connection on your account (get from calling 'vastai show connections')
</ParamField>

<ParamField path="--transfer" type="string" default="Instance to Cloud">
  type of transfer, possible options include Instance To Cloud and Cloud To Instance
</ParamField>

<ParamField path="--dry-run" type="boolean">
  show what would have been transferred
</ParamField>

<ParamField path="--size-only" type="boolean">
  skip based on size only, not mod-time or checksum
</ParamField>

<ParamField path="--ignore-existing" type="boolean">
  skip all files that exist on destination
</ParamField>

<ParamField path="--update" type="boolean">
  skip files that are newer on the destination
</ParamField>

<ParamField path="--delete-excluded" type="boolean">
  delete files on dest excluded from transfer
</ParamField>

<ParamField path="--schedule" type="string">
  try to schedule a command to run hourly, daily, or monthly. Valid values are HOURLY, DAILY, WEEKLY  For ex. `--schedule` DAILY Choices: `HOURLY`, `DAILY`, `WEEKLY`
</ParamField>

<ParamField path="--start_date" type="string">
  Start date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is now. (optional)
</ParamField>

<ParamField path="--end_date" type="string">
  End date/time in format 'YYYY-MM-DD HH:MM:SS PM' (UTC). Default is contract's end. (optional)
</ParamField>

<ParamField path="--day" type="integer" default="0">
  Day of week you want scheduled job to run on (0-6, where 0=Sunday) or "\*". Default will be 0. For ex. `--day` 0
</ParamField>

<ParamField path="--hour" type="integer" default="0">
  Hour of day you want scheduled job to run on (0-23) or "\*" (UTC). Default will be 0. For ex. `--hour` 16
</ParamField>

## Description

Copies a directory from a source location to a target location. Each of source and destination
directories can be either local or remote, subject to appropriate read and write
permissions required to carry out the action. The format for both src and dst is \[instance\_id:]path.
You can find more information about the cloud copy operation here: [https://vast.ai/docs/gpu-instances/cloud-sync](https://vast.ai/docs/gpu-instances/cloud-sync)

## Examples

```bash theme={null}
vastai show connections
 ID    NAME      Cloud Type
 1001  test_dir  drive
 1003  data_dir  drive

 vastai cloud copy --src /folder --dst /workspace --instance 6003036 --connection 1001 --transfer "Instance To Cloud"

The example copies all contents of /folder into /workspace on instance 6003036 from gdrive connection 'test_dir'.
```

## Global Options

The following options are available for all commands:

| Option          | Description                                           |
| --------------- | ----------------------------------------------------- |
| `--url URL`     | Server REST API URL                                   |
| `--retry N`     | Retry limit                                           |
| `--raw`         | Output machine-readable JSON                          |
| `--explain`     | Verbose explanation of API calls                      |
| `--api-key KEY` | API key (defaults to `~/.config/vastai/vast_api_key`) |
