2

是否有一个反向命令gcutil push基本上我想要做的是在我的本地机器上拥有我的 python 文件的副本所以我正在寻找一种方法将文件导入我的本地机器从我的谷歌计算引擎实例导出它们而不使用GIT 或任何其他源代码控制工具

4

2 回答 2

5

是的,有 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.
于 2014-02-19T17:04:53.817 回答
1

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

gcutil push --zone=us-central1-a \ my_instance \ ~/local/path /remote/file1 \ /remote/file2 \

例如在 mac

例子

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

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

gcutil pull --zone=us-central1-a \ my_instance \ /remote/file1 \ /remote/file2 \ ~/local/path

例如在 mac

例子

gcutil pull --zone=us-central1-a \your-instance \ /home/munish/source-folder ~/Desktop/destination-folder
于 2014-10-21T02:15:31.690 回答