Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-cloud-platform/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google cloud platform gsutil复制所有文件并创建子目录_Google Cloud Platform_Google Cloud Storage_Gsutil - Fatal编程技术网

Google cloud platform gsutil复制所有文件并创建子目录

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已

我在这个目录中有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
已经表示递归,这应该可以:

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