MagTun
MagTun

Reputation: 6185

Abort gsutil transfer

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.

Upvotes: 7

Views: 4580

Answers (2)

Albert
Albert

Reputation: 396

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.

Upvotes: 2

Mike Schwartz
Mike Schwartz

Reputation: 12145

You can ^C the operation under Windows/cmd.

Upvotes: 4

Related Questions