将文件从GCE导出到我的本地计算机



gcutil push有反向命令吗?基本上,我想做的是在本地机器上复制我的python文件,所以我正在寻找一种方法,将文件导入到本地机器中,从我的谷歌计算引擎实例导出文件,而无需使用GIT或任何其他源代码管理工具

是的,有gcutil pull。这是帮助文件:

Local:~ mark$ gcutil help pull
Command line tool for interacting with Google Compute Engine.
Please refer to http://developers.google.com/compute/docs/gcutil/tips for more
information about gcutil usage.

USAGE: gcutil [--global_flags] <command> [--command_flags] [args]

pull                         Pull one or more files from a VM instance.
Usage: gcutil [--global_flags] pull
[--command_flags] <instance-name> <file-1> ...
<file-n> <destination>
Flags for pull:
gcutil_lib.instance_cmds:
--ssh_arg: Additional arguments to pass to ssh;
repeat this option to specify a list of values
(default: '[]')
--ssh_key_push_wait_time: Number of seconds to wait for updates to
project-wide ssh keys to cascade to the instances within the project
(default: '120')
(an integer)
--ssh_port: TCP port to connect to
(default: '22')
(an integer)
--zone: [Required] The zone for this request.
gflags:
--flagfile: Insert flag definitions from the given file into the command line.
(default: '')
--undefok: comma-separated list of flag names that it is okay to specify on
the command line even if the program does not define a flag with that name.
IMPORTANT: flags in this list that have arguments MUST use the --flag=value
format.
(default: '')

Run 'gcutil --help' to get help for global flags.
Run 'gcutil help' to see the list of available commands.

从本地机器上传到GCE的文件语法如下

gcutil push--zone=us-central1-a\我的立场\~/本地/路径/远程/file1\/远程/file2\

例如在mac 中

示例

gcutil push --zone=us-central1-a your-instance  ~/Desktop/Gcloud /home/munish/

文件从GCE下载到本地机器的语法如下

gcutil pull--zone=us-central1-a\我的立场\/远程/file1\/远程/file2\~/本地/路径

例如在mac 中

示例

gcutil pull --zone=us-central1-a your-instance  /home/munish/source-folder ~/Desktop/destination-folder

相关内容

  • 没有找到相关文章

最新更新