【问题标题】:What does this error message mean in gsutil此错误消息在 gsutil 中的含义是什么
【发布时间】:2021-10-26 00:17:59
【问题描述】:

谁能提供有关调试此命令在 MacOS Catalina 上不起作用的建议?

~ $ gsutil cp -r gs://elium/photo.video/ /Users/alex -v
CommandException: Destination URL must name a directory, bucket, or bucket
subdirectory for the multiple source form of the cp command.
  • /Users/alex 绝对是现有文件夹

【问题讨论】:

  • 在 superuser.com 或 Unix & Linux 上可能会更好
  • 您是否正在尝试下载文件或在存储桶之间复制?你期待结尾 -v 做什么,因为那绝对不是文件夹

标签: google-cloud-platform google-cloud-storage gsutil


【解决方案1】:

您的命令末尾有令牌-v,gsutil 认为这是目标路径。当您向gsutil cp 提供多个 args 时,它认为除最后一个 arg 之外的所有 args 都是源(要复制的对象/文件),最后一个 arg 是目标(要将文件复制到的文件夹/存储桶)。

-v 标志应该所有非标志参数之前出现。尝试使用cp -r -v

【讨论】:

    【解决方案2】:

    @mhouglum 是对的!

    另外,我还要补充一点,源 URL 中的尾部斜杠会悄悄地破坏事情。 (我运行了命令但没有输出)最终的工作 cmd 是:

    gsutil cp -r -v gs://elium/photo.video /Users/alex
    

    【讨论】:

      猜你喜欢
      • 2012-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-20
      相关资源
      最近更新 更多