将文件从GCP实例复制到GCP Bucket
我遵循GSUTIL指令,将GCP Linux实例上的本地文件复制到我的存储桶中。
我从dir运行该文件为
gsutil -m cp -r gs:// bucket_name/folder1/folder2文件名
我获取这些:
commandexception:目标url必须命名目录,存储桶或存储桶 CP命令的多源形式的子目录。 CommandException:目标URL必须命名目录,存储桶或存储桶 CP命令的多源形式的子目录。 CommandException:无法传输2个文件/对象。
谢谢
I follow the gsutil instructions to copy a local file on my gcp linux instance up to my bucket.
i run the command from the dir where the file is
gsutil -m cp -r gs://bucket_name/folder1/folder2 filename
I get these:
CommandException: Destination URL must name a directory, bucket, or bucket
subdirectory for the multiple source form of the cp command.
CommandException: Destination URL must name a directory, bucket, or bucket
subdirectory for the multiple source form of the cp command.
CommandException: 2 files/objects could not be transferred.
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果文件名是要复制到云存储的本地文件,请使用以下命令:
-r
命令行选项均值递归复制。指定单个文件时,您不会使用它。您的来源和目标参数也相反Provided that filename is a local file that you want to copy to Cloud Storage, use this command:
The
-r
command line option means recursive copy. You would not use that when specifying a single file. Your source and destination parameters were also reversed请按照以下方式修改您的命令。
gsutil -M CP文件名gs:// bucket_name/folder1/folder2
它应该起作用。
Please modify your command like below.
gsutil -m cp filename gs://bucket_name/folder1/folder2
It should work.