GoogleCloudPlatform / GoogleCloudPlatform/gsutil

Copy files with the same name but from different GCS locations to local directory

Open
#1,161 1 comment 5 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
918
Forks
335
PR merge metrics
No merged PRs in 30d

Description

I want to download a bunch of files really quickly, and I have the URIs to all my files in a txt file. Usually I would do something like this:
```
$ cat my_uris.txt | gsutil -m cp -I .
```
However, all my URIs look like this:
```
gs://my-bucket/long_convoluted_path_1/file.txt
gs://my-bucket/long_convoluted_path_2/file.txt
gs://my-bucket/long_convoluted_path_3/file.txt
gs://my-bucket/long_convoluted_path_4/file.txt
...
```
So if I try to download all the files to a directory, they just write on top of eachother since they are all being downloaded to `file.txt`. How do I download them each to different names?

Contributor guide

Open the contributing guide

Research direction

Start with the `gsutil -m cp -I` command and the listed GCS URI input pattern. No source file or test is identified in the issue; done would mean determining and documenting a supported way for each input URI to produce a distinct local filename without overwriting another file.

Written by the indexing model from the issue text.

Assessment

Tech stack
google-cloud
Domain
cli, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.