Azure存储blob上传子目录递归不工作


        filter="$dir_to_upload*"
        for file in $filter; do
            azure storage blob upload -q $file $container_name $(basename $file)
        done

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

当$文件实际上是一个目录时,您不能调用"azure storage blob upload"。实际上,为了递归地枚举目录下的文件(目录除外),您可以简单地调用"find $dir_to_upload -type f"来执行此操作。

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

最新更新