AZure azcopy Linux - 如何将变量传递给 azcopy

标签 azure azure-blob-storage azcopy

美好的一天

我想将 $mm 的值传递给此 azcopy。但是,由于 azcopy 参数用双引号引起来,因此它不希望正确处理。

 $mm=04 ; start=`echo "START DATE: $(date)"` ; azcopy cp "https://reco.blob.core.windows.net/raw-voi-2022/2022-$mm/*?sv=2020-0RgUNH8A%3D" "https://storage.blob.core.windows.net/bin-voi-2022/2022-$mm?sv=2021-0HGICxvaLULI%3D"

结果:

Job 24fa36ea-8bda-cc4f-632a-07db4d922036 has started
Log file is located at: /log/azcopy/24fa36ea-8bda-cc4f-632a-07db4d922036.log

100.0 %, 0 Done, 0 Failed, 0 Pending, 0 Skipped, 0 Total,

                                                                                                                                                                                          Job 24fa36ea-8bda-cc4f-632a-07db4d922036 summary                                                                                                                                          Elapsed Time (Minutes): 0.0333
Number of File Transfers: 0
Number of Folder Property Transfers: 0
Number of Symlink Transfers: 0
Total Number of Transfers: 0
Number of File Transfers Completed: 0
Number of Folder Transfers Completed: 0
Number of File Transfers Failed: 0
Number of Folder Transfers Failed: 0
Number of File Transfers Skipped: 0
Number of Folder Transfers Skipped: 0
TotalBytesTransferred: 0
Final Job Status: Completed

谢谢。

最佳答案

我总结了我们的讨论,并将上述评论作为答案发布。

由于您在 Linux 中运行上述 cmdlet,因此需要使用 mm=04 初始化变量,而不是使用 $mm=04

关于AZure azcopy Linux - 如何将变量传递给 azcopy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76602233/

相关文章:

c# - 如何在ASP.NET服务器的web.config文件中使用Azure Pipeline中设置的环境变量?

visual-studio-2012 - Windows Azure 项目错误 CctSharedPackage 未正确加载

c# - 让 CloudBlobContainer 对象成为 transient 可以吗?

azure - 为什么我看不到存储帐户中上传的文件记录

azure - 将 Azure 存储帐户中的文件夹复制到同一存储帐户中的另一个文件夹

azure - 在 Azure WebJob 中使用 Akka.net Ask 超时

azure - 如何从Azure指标获取 "Network In"和 "Network Out"?

Azure Blob 存储和安全性

windows - 如何在 Windows 任务计划程序上安排 azcopy?

Azure 文件复制在构建管道中第二次运行时失败