我正在尝试使用AzCopy for从我的Ubuntu机器上传一个示例文件到Azure,但是无论我更改到什么权限/所有权,我都会得到以下错误。
$ azcopy --source ../my_pub --destination https://account-name.blob.core.windows.net/mycontainer --dest-key account-key
Incomplete operation with same command line detected at the journal directory "/home/jmis/Microsoft/Azure/AzCopy", do you want to resume the operation? Choose Yes to resume, choose No to overwrite the journal to start a new operation. (Yes/No) Yes
[2017/11/18 22:06:24][ERROR] Error parsing source location "../my_pub": Failed to enumerate directory /home/jmis/my_pub/ with file pattern *. Cannot find the path '/home/jmis/my_pub/'.我一直在互联网上寻找解决方案,没有运气,我最终在这里问了一个问题。
发布于 2017-11-20 07:49:48
我们可以使用这个脚本将单个文件上传到Azcopy(Linux):
azcopy \
--source /mnt/myfiles \
--destination https://myaccount.file.core.windows.net/myfileshare/ \
--dest-key <key> \
--include abc.txt使用--include指定要上载哪个文件,下面是一个示例,请检查它:
root@jasonubuntu:/jason# pwd
/jason
root@jasonubuntu:/jason# ls
test1
root@jasonubuntu:/jason# azcopy --source /jason/ --destination https://jasondisk3.blob.core.windows.net/jasonvm/ --dest-key m+kQwLuQZiI3LMoMTyAI8K40gkOD+ZaT9HUL3AgVr2KpOUdqTD/AG2j+TPHBpttq5hXRmTaQ== --recursive --include test1
Finished 1 of total 1 file(s).
[2017/11/20 07:45:57] Transfer summary:
-----------------
Total files transferred: 1
Transfer successfully: 1
Transfer skipped: 0
Transfer failed: 0
Elapsed time: 00.00:00:02
root@jasonubuntu:/jason# 更多关于Linux上的Azcopy的信息,请参考这个链接。
发布于 2017-11-20 07:20:13
虽然AzCopy对Linux有问题,但我可以使用Azure无缝地完成上面的操作。Azure博士上列出的以下代码帮助我做到了这一点:
#!/bin/bash
# A simple Azure Storage example script
export AZURE_STORAGE_ACCOUNT=<storage_account_name>
export AZURE_STORAGE_ACCESS_KEY=<storage_account_key>
export container_name=<container_name>
export blob_name=<blob_name>
export file_to_upload=<file_to_upload>
export destination_file=<destination_file>
echo "Creating the container..."
az storage container create --name $container_name
echo "Uploading the file..."
az storage blob upload --container-name $container_name --file $file_to_upload --name $blob_name
echo "Listing the blobs..."
az storage blob list --container-name $container_name --output table
echo "Downloading the file..."
az storage blob download --container-name $container_name --name $blob_name --file $destination_file --output table
echo "Done"接下来,我将使用Cool,这是Linux兼容的,也是简单的。
https://stackoverflow.com/questions/47374186
复制相似问题