Warm tip: This article is reproduced from serverfault.com, please click

Can't download GSuite exported data using gsutil

发布于 2020-12-02 07:38:43

I am trying to download the exported data from my GSuite (Google Workplace) account. I ran the data export tool and it is sitting in a bucket. I want to download all of the files but it says that the only way I can download multiple files is to use the gsutil utility.

I installed it using pip instal -U gsutil.

I tried running the following command:

gsutil cp -r \
  gs://takeout-export-3ba9a6a2-c080-430a-bece-6f830889cc83/20201202T070520Z/ \
  gs://takeout-export-3ba9a6a2-c080-430a-bece-6f830889cc83/Status\ Report.html \
  .

...but it failed with an error:

ServiceException: 401 Anonymous caller does not have storage.objects.get access to the Google Cloud Storage object.

I suppose that is because I am not authenticated. I tried going through the motions with gsutil config, but it is now asking me for a "Project ID", which I cannot find anywhere in the cloud storage web page showing the bucket with the exported files.

I tries following the top answer for this question, but the project ID does not appear to be optional anymore.

How do I download my files?

Questioner
wheeler
Viewed
0
mhouglum 2020-12-02 17:14:02

The project ID is "optional" in the sense that it's only used for certain scenarios, e.g. when you want to create a bucket (without explicitly specifying a project for it to live in), that project is specified as its parent. For most things, like your scenario of copying existing GCS objects to your local filesystem, your default project ID doesn't matter; you can just type whatever you want for the project ID in order to generate your boto file for authentication.