5

I am transferring a folder containing 100+ heavy files (several hundred MB) gsutil to my google cloud storage (Nearline). I've made a mistake in path of the destination folder. So I am looking for a way to abort the transfer.

Here is the command I used:

python c:\gsutil\gsutil -m cp -r -n berlin gs://bucket/berlin

So only solution I know (I am a newbie) is to simply close CMD. But I guess this isn't the right way to do it and I wonder what will happen to the temporary files (the files that were uploading but not completed when I closed CMD).

So here are my questions:

  1. Is there another way to abort the transfer than closing CMD?
  2. If this is the only solution, should I care about the temporary files : e.g. should I delete then to avoid unnecessary storage fee? If yes, how can I do that.
MagTun
  • 5,619
  • 5
  • 63
  • 104

2 Answers2

3

You can ^C the operation under Windows/cmd.

Mike Schwartz
  • 11,511
  • 1
  • 33
  • 36
  • Thanks Mike. Do you mean Ctrl-C? If yes, I tried but it didn't stop the transfer. – MagTun Nov 22 '15 at 15:42
  • That's odd. What about Ctrl-BREAK? – Brandon Yarbrough Nov 22 '15 at 17:47
  • CTRL+SHIFT+C worked for me : it's giving me `Caugh signal 2 - exiting` – MagTun Nov 23 '15 at 07:18
  • 1
    Actually CTRL+Shift+C, only works for none multi-threaded transfer. This shorcut doesn't work when the command is python `c:\gsutil\gsutil -m cp -r -n berlin gs://bucket/berlin`. I also tried on [Clink](https://mridgers.github.io/clink/) but here again it doesn't work for multi-threaded transfer – MagTun Nov 23 '15 at 07:40
  • What version of Windows are you using? I was able to Ctrl-C a multi-threaded gsutil running on Windows 7. – Mike Schwartz Nov 23 '15 at 17:03
1

mike-schwartz (the Boulder one, maybe the Austin one) is correct, but there is a little more that can be added. Uploads are resumable.

Cp has an automatic protocol which stores upload information in the .gsutil folder. It is documented in the resumable transfers section of the gsutil cp command.

There is also an Google api json article about sending a DELETE request (presumably 'gsutil delete gs://...whatever' but the example simply shows 'DELETE ...') but you probably want to edit (e.g. make a subfolder and move those items to it until you are certain they can be permanently removed) the contents of your .gsutil to clear the ones you want cancelled removed. It would be useful to have a flag that ignores or clears the resumables on a particular target rather than manually editing a folder contents.

Albert
  • 356
  • 4
  • 7