将文件从GCP实例复制到GCP Bucket

发布于 2025-01-30 15:55:59 字数 292 浏览 2 评论 0原文

我遵循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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

独享拥抱 2025-02-06 15:55:59

如果文件名是要复制到云存储的本地文件,请使用以下命令:

gsutil -m cp filename gs://bucket_name/folder1/folder2

-r命令行选项均值递归复制。指定单个文件时,您不会使用它。您的来源和目标参数也相反

Provided that filename is a local file that you want to copy to Cloud Storage, use this command:

gsutil -m cp filename gs://bucket_name/folder1/folder2

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

巡山小妖精 2025-02-06 15:55:59

请按照以下方式修改您的命令。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文