Move files between folders in Google Cloud Storage using the Google Cloud Console

I uploaded several files to the same folder in Google Cloud Storage using the Google Cloud Console. Now I would like to move several files to a newly created folder in Google Cloud Storage, and I cannot figure out how to do this using the Google Cloud Console. I found instructions on moving files using command line commands on gsutil . However, I am not comfortable working with command line interfaces and could not get gsutil to work on my machine.

Is there a way to move files in Google Cloud Storage from one folder to another through the Google Cloud Console?

+5
source share
2 answers

Update: As of July 12, 2015, there is an alpha version of Google Cloud Shell that provides a terminal on the Google Cloud Console website without the need to manually create virtual machines: this is an f1-micro instance with gsutil pre-installed and pre-authenticated.

Googleโ€™s virtual shell is free for the alpha period, but since it is in alpha, there is currently no SLA.


If you are having problems installing gsutil on your computer, consider the following approach:

  • Copy the f1-micro instance with the Google-provided Debian image that gsutil will preinstall.

  • Use the SSH button to connect to it using the browser interface (you can also use the gcutil or gcloud if you have installed and available).

  • Run gcloud auth login --no-launch-browser inside the instance. It will provide you with a URL that will be opened in your browser. After opening it, grant OAuth permissions and display the code. Paste this code back into the command window where you ran the command to get the authentication token.

  • Run the gsutil mv command as suggested by Travis Hobrla:

    gsutil mv gs://bucket/source-object gs://bucket/dest-object

  • Once you are done with gsutil , delete the instance by clicking the Delete button at the top of the virtual machine instance details page. Make sure that the "Delete boot disk when deleting an instance" checkbox on the same page of the virtual machine instance is checked so that you do not leave an axis with an orphan for which you will pay.

    You can also browse your permanent drives on the Drives tab, directly below the VM instances tab, and manually delete drives there, or make sure that there are no lost drives in the future.

    / li>

Given the current price of $ 0.013 / hour for an f1-micro instance, this should cost you less than a penny to do this, since you will only be charged during the lifetime of the instance.

+5
source

There is currently no way to do this using the Google Cloud Console.

Because folders in Google Cloud Storage are just placeholders in a flat namespace, it is not possible to atomically move or rename a folder, so this scenario is more complicated than moving a folder in the local file system (with a hierarchical namespace). Therefore, a more sophisticated tool, such as gsutil .

+2
source

Source: https://habr.com/ru/post/1200704/


All Articles