Google cloud platform gsutil复制所有文件并创建子目录
我在这个目录中有4个文件xxxxx.xlsx:Google cloud platform gsutil复制所有文件并创建子目录,google-cloud-platform,google-cloud-storage,gsutil,Google Cloud Platform,Google Cloud Storage,Gsutil,我在这个目录中有4个文件xxxxx.xlsx: /var/tmp/dagxxxxx/2019-08-10/xxxxx.xlsx 我想把它们复制到: gs://reports_dev/2019 使用gsutil cp-r,最终的gcs路径应该如下(包含所有4个文件): 我尝试了cp和-r的不同组合,比如: gsutil cp -r /var/tmp/dagxxxxx/2019-08-10/** gs://reports_dev/2019 但无法在gcs中获得所需的路径 删除后面的星号,-r已
/var/tmp/dagxxxxx/2019-08-10/xxxxx.xlsx
我想把它们复制到:
gs://reports_dev/2019
使用gsutil cp-r,最终的gcs路径应该如下(包含所有4个文件):
我尝试了cp和-r的不同组合,比如:
gsutil cp -r /var/tmp/dagxxxxx/2019-08-10/** gs://reports_dev/2019
但无法在gcs中获得所需的路径 删除后面的星号,
-r
已经表示递归,这应该可以:
gsutil cp -r /var/tmp/dagxxxxx/2019-08-10/ gs://reports_dev/2019
如果在源文件中附加正斜杠/
,它会将文件夹复制到目标文件,如果不添加正斜杠,它会将源文件的内容复制到目标文件
gsutil cp -r /var/tmp/dagxxxxx/2019-08-10/ gs://reports_dev/2019