File: //snap/google-cloud-cli/current/help/man/man1/gcloud_alpha_compute_copy-files.1
.TH "GCLOUD_ALPHA_COMPUTE_COPY\-FILES" 1
.SH "NAME"
.HP
gcloud alpha compute copy\-files \- copy files to and from Google Compute Engine virtual machines via scp
.SH "SYNOPSIS"
.HP
\f5gcloud alpha compute copy\-files\fR [[\fIUSER\fR@]\fIINSTANCE\fR:]\fISRC\fR [[[\fIUSER\fR@]\fIINSTANCE\fR:]\fISRC\fR\ ...] [[\fIUSER\fR@]\fIINSTANCE\fR:]\fIDEST\fR [\fB\-\-dry\-run\fR] [\fB\-\-force\-key\-file\-overwrite\fR] [\fB\-\-plain\fR] [\fB\-\-ssh\-key\-file\fR=\fISSH_KEY_FILE\fR] [\fB\-\-strict\-host\-key\-checking\fR=\fISTRICT_HOST_KEY_CHECKING\fR] [\fB\-\-zone\fR=\fIZONE\fR] [\fB\-\-ssh\-key\-expiration\fR=\fISSH_KEY_EXPIRATION\fR\ |\ \fB\-\-ssh\-key\-expire\-after\fR=\fISSH_KEY_EXPIRE_AFTER\fR] [\fIGCLOUD_WIDE_FLAG\ ...\fR]
.SH "DESCRIPTION"
\fB(ALPHA)\fR \fBgcloud alpha compute copy\-files\fR copies files between a
virtual machine instance and your local machine using the scp command. This
command does not work for Windows VMs.
To denote a remote file, prefix the file name with the virtual machine instance
name (e.g., \fIexample\-instance\fR:~/\fIFILE\fR). To denote a local file, do
not add a prefix to the file name (e.g., ~/\fIFILE\fR).
If a file contains a colon (``:''), you must specify it by either using an
absolute path or a path that begins with ``./''.
Under the covers, \fBscp(1)\fR or pscp (on Windows) is used to facilitate the
transfer.
When the destination is local, all sources must be the same virtual machine
instance. When the destination is remote, all sources must be local.
.SH "EXAMPLES"
To copy a remote directory '~/REMOTE\-DIR' on the instance of
\'example\-instance' to '~/LOCAL\-DIR' on the local host, run:
.RS 2m
$ gcloud alpha compute copy\-files example\-instance:~/REMOTE\-DIR \e
~/LOCAL\-DIR \-\-zone=us\-central1\-a
.RE
To copy files from your local host to a virtual machine, run:
.RS 2m
$ gcloud alpha compute copy\-files ~/LOCAL\-FILE\-1 ~/LOCAL\-FILE\-2 \e
example\-instance:~/REMOTE\-DIR \-\-zone=us\-central1\-a
.RE
.SH "POSITIONAL ARGUMENTS"
.RS 2m
.TP 2m
[[\fIUSER\fR@]\fIINSTANCE\fR:]\fISRC\fR [[[\fIUSER\fR@]\fIINSTANCE\fR:]\fISRC\fR ...]
Specifies the files to copy.
.TP 2m
[[\fIUSER\fR@]\fIINSTANCE\fR:]\fIDEST\fR
Specifies a destination for the source files.
.RE
.sp
.SH "FLAGS"
.RS 2m
.TP 2m
\fB\-\-dry\-run\fR
Print the equivalent scp/ssh command that would be run to stdout, instead of
executing it.
.TP 2m
\fB\-\-force\-key\-file\-overwrite\fR
If enabled, the gcloud command\-line tool will regenerate and overwrite the
files associated with a broken SSH key without asking for confirmation in both
interactive and non\-interactive environments.
If disabled, the files associated with a broken SSH key will not be regenerated
and will fail in both interactive and non\-interactive environments.
.TP 2m
\fB\-\-plain\fR
Suppress the automatic addition of \fBssh(1)\fR/\fBscp(1)\fR flags. This flag is
useful if you want to take care of authentication yourself or use specific
ssh/scp features.
.TP 2m
\fB\-\-ssh\-key\-file\fR=\fISSH_KEY_FILE\fR
The path to the SSH key file. By default, this is
\f5\fI~/.ssh/google_compute_engine\fR\fR.
.TP 2m
\fB\-\-strict\-host\-key\-checking\fR=\fISTRICT_HOST_KEY_CHECKING\fR
Override the default behavior of StrictHostKeyChecking for the connection. By
default, StrictHostKeyChecking is set to 'no' the first time you connect to an
instance, and will be set to 'yes' for all subsequent connections.
\fISTRICT_HOST_KEY_CHECKING\fR must be one of: \fByes\fR, \fBno\fR, \fBask\fR.
.TP 2m
\fB\-\-zone\fR=\fIZONE\fR
The zone of the instance to copy files to/from.
If not specified and the \f5\fIcompute/zone\fR\fR property isn't set, you might
be prompted to select a zone (interactive mode only).
To avoid prompting when this flag is omitted, you can set the
\f5\fIcompute/zone\fR\fR property:
.RS 2m
$ gcloud config set compute/zone ZONE
.RE
A list of zones can be fetched by running:
.RS 2m
$ gcloud compute zones list
.RE
To unset the property, run:
.RS 2m
$ gcloud config unset compute/zone
.RE
Alternatively, the zone can be stored in the environment variable
\f5\fICLOUDSDK_COMPUTE_ZONE\fR\fR.
.TP 2m
At most one of these can be specified:
.RS 2m
.TP 2m
\fB\-\-ssh\-key\-expiration\fR=\fISSH_KEY_EXPIRATION\fR
The time when the ssh key will be valid until, such as
"2017\-08\-29T18:52:51.142Z." This is only valid if the instance is not using OS
Login. See $ gcloud topic datetimes for information on time formats.
.TP 2m
\fB\-\-ssh\-key\-expire\-after\fR=\fISSH_KEY_EXPIRE_AFTER\fR
The maximum length of time an SSH key is valid for once created and installed,
e.g. 2m for 2 minutes. See $ gcloud topic datetimes for information on duration
formats.
.RE
.RE
.sp
.SH "GCLOUD WIDE FLAGS"
These flags are available to all commands: \-\-access\-token\-file, \-\-account,
\-\-billing\-project, \-\-configuration, \-\-flags\-file, \-\-flatten,
\-\-format, \-\-help, \-\-impersonate\-service\-account, \-\-log\-http,
\-\-project, \-\-quiet, \-\-trace\-token, \-\-user\-output\-enabled,
\-\-verbosity.
Run \fB$ gcloud help\fR for details.
.SH "NOTES"
This command is currently in alpha and might change without notice. If this
command fails with API permission errors despite specifying the correct project,
you might be trying to access an API with an invitation\-only early access
allowlist. These variants are also available:
.RS 2m
$ gcloud compute copy\-files
.RE
.RS 2m
$ gcloud beta compute copy\-files
.RE