Question

Is there a reverse command for gcutil push basically what I want to do is have a copy of my python files on my local machine so I'm looking for a way to import the files into my local machine exporting them from my google compute engine instance without using GIT or any other source control tool

Was it helpful?

Solution

Yep, there is gcutil pull. Here is the help file:

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.

OTHER TIPS

The Syntax of file uploading to GCE from your Local Machine as following

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

for example in mac

example

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

The Syntax of file downloading from GCE to your Local Machine as following

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

for example in mac

example

gcutil pull --zone=us-central1-a \your-instance \ /home/munish/source-folder ~/Desktop/destination-folder
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top