在Windows环境下,我们可以使用AzCopy批量上传文件。其效率和传输速率都是非常快的。

在Linux或MacOS环境下,可以使用Azure的CLI实现批量文件的上传。

下面的脚本可以实现此功能。

#!/bin/bash
container=hwc
btype=block
storageaccount=hwtest
storagekey=pBHrx8d+LDAkyHm2ffljPYygsiSBlbdQh8O45iV12BlFvdjI8kXbqtE17PlpCG0pfTU3yaBQUEEuWuM0tIsobw==
files=`ls -l | awk '/rw/ {print $9}'`
for file in $files
do
  if [ -f $file ]; then
      /usr/local/bin/azure storage blob upload -f ./$file --container $container -b $file -t $btype -a $storageaccount -k $storagekey
  else
      echo "$file is a Directory"
  fi
done

其中的各个变量可以根据各自的实际情况修改。

相关文章:

  • 2021-12-01
  • 2021-11-09
  • 2021-10-07
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
  • 2021-12-11
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2021-09-29
  • 2022-12-23
  • 2022-01-13
相关资源
相似解决方案