Skip to content

Instantly share code, notes, and snippets.

@myselfhimself
Created December 6, 2017 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save myselfhimself/e6d038ba10e755ed2b69f3b1f9468165 to your computer and use it in GitHub Desktop.
Save myselfhimself/e6d038ba10e755ed2b69f3b1f9468165 to your computer and use it in GitHub Desktop.
Copying directory contents onto a Google Cloud Compute engine's instance with scp
#!/bin/sh
gcloud compute scp --project "myproject" --zone "my-zone" --scp-flag=-r ~/my-local-path "remote-image-name":/home/my-remote-path
@myselfhimself
Copy link
Author

The trick lies in "--scp-flag=-r"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment