Skip to main content
Copy files/folders to and from cloud providers

Usage

vastai cloud copy --src SRC --dst DST --instance INSTANCE_ID -connection CONNECTION_ID --transfer TRANSFER_TYPE

Options

--src
string
path to source of object to copy
--dst
string
default:"/workspace"
path to target of copy operation
--instance
string
id of the instance
--connection
string
id of cloud connection on your account (get from calling ‘vastai show connections’)
--transfer
string
default:"Instance to Cloud"
type of transfer, possible options include Instance To Cloud and Cloud To Instance
--dry-run
boolean
show what would have been transferred
--size-only
boolean
skip based on size only, not mod-time or checksum
--ignore-existing
boolean
skip all files that exist on destination
--update
boolean
skip files that are newer on the destination
--delete-excluded
boolean
delete files on dest excluded from transfer
--schedule
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
--start_date
string
default:"2026-02-24"
Start date/time in format ‘YYYY-MM-DD HH:MM:SS PM’ (UTC). Default is now. (optional)
--end_date
string
End date/time in format ‘YYYY-MM-DD HH:MM:SS PM’ (UTC). Default is contract’s end. (optional)
--day
parse_day_cron_style
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
--hour
parse_hour_cron_style
default:"0"
Hour of day you want scheduled job to run on (0-23) or ”*” (UTC). Default will be 0. For ex. —hour 16

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

Examples

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:
OptionDescription
--url URLServer REST API URL
--retry NRetry limit
--rawOutput machine-readable JSON
--explainVerbose explanation of API calls
--api-key KEYAPI key (defaults to ~/.config/vastai/vast_api_key)