Skip to main content
Copy files between cloud and instance.

Signature

VastAI.cloud_copy(
    src: Optional[str] = None,
    dst: Optional[str] = '/workspace',
    instance: Optional[str] = None,
    connection: Optional[str] = None,
    transfer: Optional[str] = 'Instance to Cloud',
    dry_run: bool = False,
    size_only: bool = False,
    ignore_existing: bool = False,
    update: bool = False,
    delete_excluded: bool = False,
    schedule: Optional[str] = None,
    start_date: Optional[str] = '2026-06-23',
    end_date: Optional[str] = None,
    day: Optional[parse_day_cron_style] = 0,
    hour: Optional[parse_hour_cron_style] = 0
) -> dict

Parameters

src
Optional[str]
path to source of object to copy
dst
Optional[str]
default:"/workspace"
path to target of copy operation
instance
Optional[str]
id of the instance
connection
Optional[str]
id of cloud connection on your account (get from calling ‘vastai show connections’)
transfer
Optional[str]
default:"Instance to Cloud"
type of transfer, possible options include Instance To Cloud and Cloud To Instance
dry_run
bool
show what would have been transferred
size_only
bool
skip based on size only, not mod-time or checksum
ignore_existing
bool
skip all files that exist on destination
update
bool
skip files that are newer on the destination
delete_excluded
bool
delete files on dest excluded from transfer
schedule
Optional[str]
try to schedule a command to run hourly, daily, or weekly. Valid values are HOURLY, DAILY, WEEKLY For ex. —schedule DAILY
start_date
Optional[str]
default:"2026-06-23"
Start date/time in format ‘YYYY-MM-DD HH:MM:SS PM’ (UTC). Default is now. (optional)
end_date
Optional[str]
End date/time in format ‘YYYY-MM-DD HH:MM:SS PM’ (UTC). Default is contract’s end. (optional)
day
Optional[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
Optional[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

Returns

dict

Example

from vastai import VastAI

client = VastAI(api_key="YOUR_API_KEY")
result = client.cloud_copy()
print(result)