【问题标题】:azure storage blob upload subdirectories recursive not working天蓝色存储blob上传子目录递归不起作用
【发布时间】:2015-11-06 04:16:34
【问题描述】:
        filter="$dir_to_upload*"
        for file in $filter; do
            azure storage blob upload -q $file $container_name $(basename $file)
        done

我想编写一个使用 azure cli 上传子目录和文件的 shell 脚本,但每次脚本遇到目录时,它都会跳过并抛出错误 "error: storage blob upload command failed" 说这不是文件。如何以类似于 azcopy /S 的方式递归上传子目录和文件。

【问题讨论】:

    标签: azure storage command-line-interface azure-storage


    【解决方案1】:

    当 $file 实际上是一个目录时,您不能调用“azure storage blob upload”。实际上,为了递归地枚举一个目录下的文件(目录除外),您可以简单地调用“find $dir_to_upload -type f”来做到这一点。

    【讨论】:

    • 我试过这个,但在逐个文件上传时速度很慢。趋势 我从 Azure 获得超时会话。还有其他类似于 AzCopy 的方法吗?
    • 可以参考杨夏的回答。
    【解决方案2】:

    Azure CLI 本身不会以递归方式并行上传目录中的文件。在使用“find $dir_to_upload -type f”时,您可能还想尝试GNU parallel 并检查它是否有帮助。但请注意操作失败或被中断时的错误处理。

    【讨论】:

      猜你喜欢
      • 2019-02-24
      • 1970-01-01
      • 2022-01-08
      • 1970-01-01
      • 2015-09-09
      • 1970-01-01
      • 2019-08-11
      • 2022-01-12
      • 2017-05-30
      相关资源
      最近更新 更多