I have three folders in a storage bucket, each containing test_result_0.xml
:
gs://test-lab-12345-67890/2018-02-23_18:48:45.403202_urtc/Nexus6P-27-en_US-portrait/test_result_0.xml
gs://test-lab-12345-67890/2018-02-23_18:48:45.403202_urtc/Nexus7-21-en_US-portrait/test_result_0.xml
gs://test-lab-12345-67890/2018-02-23_18:48:45.403202_urtc/Nexus6P-23-en_US-portrait/test_result_0.xml
Now I'm looking to copy them into a local folder, and rename them to something like:
test_result_0.xml
test_result_1.xml
test_result_2.xml
What is the best way to go about doing that, using a bash script? I have this so far, but it doesn't work :(
for i in $("`gsutil ls gs://test-lab-12345-67890 | tail -1`*/*.xml"); do
gsutil -m cp -r -U $i ~/Documents
done