CentOS 7安裝Azcopy

衡子發表於2017-10-18

Azcopy是Azure儲存一個非常好用的工具。本文將介紹如何在CentOS7下安裝的過程。

更新:目前需要.net core 2.0版本。具體下載地址大家自己搜尋。

1 安裝.net core 1.1.1版本

.net core 1.1.1的下載資訊在github上:

https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.1.1-download.md

在下載安裝前,先裝兩個庫:

yum install libunwind libicu

然後下載.net core的包:

curl -sSL -o dotnet.tar.gz https://go.microsoft.com/fwlink/?LinkID=843420

下載後解壓到制定目錄:

mkdir -p /opt/dotnet && tar zxf dotnet.tar.gz -C /opt/dotnet
ln -s /opt/dotnet/dotnet /usr/local/bin

2 安裝azcopy

下載azcopy的包:

wget -O azcopy.tar.gz https://aka.ms/downloadazcopyprlinux

解壓:

tar -xf azcopy.tar.gz

安裝:

./install.sh

安裝完成後,可以執行azcopy:

[root@hwmig01 ~]# azcopy
------------------------------------------------------------------------------
azcopy 6.0.0-netcorepreview Copyright (c) 2017 Microsoft Corp. All Rights Reserved.
------------------------------------------------------------------------------
# azcopy is designed for high-performance uploading, downloading, and copying
data to and from Microsoft Azure Blob, and File storage.
 
# Command Line Usage:
azcopy --source <source> --destination <destination> [options]
 
# Options:
[--source-key] [--dest-key] [--source-sas] [--dest-sas] [--verbose] [--resume]
[--config-file] [--quiet] [--parallel-level] [--source-type] [--dest-type]
[--recursive] [--include] [--check-md5] [--dry-run] [--preserve-last-modified-time]
[--exclude-newer] [--exclude-older] [--sync-copy] [--set-content-type] [--blob-type]
[--delimiter] [--include-snapshot]
 
------------------------------------------------------------------------------
For azcopy command-line help, type one of the following commands:
# Detailed command-line help for azcopy --- azcopy --help
# Detailed help for any azcopy option --- azcopy --help source-key
# Command line samples --- azcopy --help sample
You can learn more about azcopy at http://aka.ms/azcopy.
------------------------------------------------------------------------------

上傳檔案測試:

azcopy --source ./ --destination https://testfg.blob.core.chinacloudapi.cn/file --dest-key xxxxxxx
[2017/10/18 07:43:58] Transfer summary:
-----------------
Total files transferred: 16
Transfer successfully:   16
Transfer skipped:        0
Transfer failed:         0
Elapsed time:            00.00:00:10

上傳成功。

 

相關文章