11 Listing specific files to transfer
John Rusk [MSFT] редактировал(а) эту страницу 2020-04-23 20:54:01 +12:00

You can create a list of specific files (or directories) to transfer, and then tell AzCopy to transfer only those exact files. As of version 10.3, this flag remains undocumented (except for this wiki page) and it does not appear in the in-app command line help. It is however regularly used by Azure Storage Explorer to pass file lists to its embedded copy of AzCopy.

(The reason that it's undocumented is that, at high file counts, it has slow performance for downloads and service-to-service copies. We want to fix that before we document it more officially).

To use this feature, create a text file that lists the files to be transferred, which are all under the root source directory.

Example file:

File_1.pdf
subdirA\File_2.pdf

Then, invoke AzCopy like this for uploads:

AzCopy copy d:\sourceDir "http://urlToDestination" --list-of-files fullPathToYourTextFile

And it will transfer the files d:\sourceDir\File_1.pdf and d:\sourceDir\subdirA\File_2.pdf

For downloads, the process is similar - the names in the file are appended to the source container/virtual directory to produce the full URLs of the files to download.

(BTW, you can also list directories as well as individual files. You should also add the --recursive flag to your command line in that case).


Prior to version 10.3, the file had a JSON format that looked like this

{
   "Files":[
      "File_1.pdf",
      "subdirA/File_2.pdf"
   ]
}