본문 바로가기

Azure

[Info] AzCopy 4.1.0-preview /?

앞에서 AzCopy를 설치 하였습니다.

명령어는 내용이 많기 때문에 /?를 이용한 각 명령어의 정보를 올려드리니

보시면 이런 기능들이 가능하다는 것 정도만 읽어 보시면 될 것 같습니다.

   

4.1.0 Preview 버전의 정보로 업데이트 해서 올리며, Tool이 업데이트 되면서 명령어의 추가 등이 생길 수 있습니다.

   

AzCopy Tool 설명서

http://azure.microsoft.com/en-us/documentation/articles/storage-use-azcopy/

   

   

[AzCopy Tool 명령어 정보]

   

   

------------------------------------------------------------------------------

AzCopy 4.1.0-preview Copyright (c) 2014 Microsoft Corp. All Rights Reserved.

------------------------------------------------------------------------------

   

AzCopy </Source:> </Dest:> [/SourceKey:] [/DestKey:] [/V:] [/Z:] [/@:] [/Y]

[/SourceSAS:] [/DestSAS:] [/SourceType:] [/DestType:] [/S] [/Pattern:]

[/CheckMD5] [/L] [/MT] [/XN] [/XO] [/A] [/IA] [/XA] [/NC:] [/SyncCopy]

[/SetContentType] [/BlobType:] [/Delimiter:] [/Snapshot] [/PKRS:]

[/SplitSize:] [/EntityOperation:] [/Manifest:]

   

   

##

## Common Options ##

##

   

   

/Source:<source> Specifies the source data from which to copy.

The source can be a file system directory, a

blob container, a blob virtual directory, a

storage file share, a storage file directory,

or an Azure table.

   

/Dest:<destination> Specifies the destination to copy to. The

destination can be a file system directory,

a blob container, a blob virtual directory,

a storage file share, a storage file

directory, or an Azure table.

   

/SourceKey:<storage-key> Specifies the storage account key for the

source resource.

   

/DestKey:<storage-key> Specifies the storage account key for the

destination resource.

   

/V:[verbose-log-file] Outputs verbose status messages into a log

file.

By default, the verbose log file is named

AzCopyVerbose.log in

%LocalAppData%\Microsoft\Azure\AzCopy. If you

specify an existing file location for this

option, the verbose log will be appended to

that file.

   

/Z:[journal-file-folder] Specifies a journal file folder for resuming an

operation.

AzCopy always supports resuming if an

operation has been interrupted.

If this option is not specified, or it is

specified without a folder path, then AzCopy

will create the journal file in the default

location, which is

%LocalAppData%\Microsoft\Azure\AzCopy.

Each time you issue a command to AzCopy, it

checks whether a journal file exists in the

default folder, or whether it exists in a

folder that you specified via this option. If

the journal file does not exist in either

place, AzCopy treats the operation as new and

generates a new journal file.

If the journal file does exist, AzCopy will

check whether the command line that you input

matches the command line in the journal file.

If the two command lines match, AzCopy resumes

the incomplete operation. If they do not match,

you will be prompted to either overwrite the

journal file to start a new operation, or to

cancel the current operation.

The journal file is deleted upon successful

completion of the operation.

Note that resuming an operation from a journal

file created by a previous version of AzCopy

is not supported.

   

/@:<parameter-file> Specifies a file that contains parameters.

AzCopy processes the parameters in the file

just as if they had been specified on the

command line.

In a response file, you can either specify

multiple parameters on a single line, or

specify each parameter on its own line. Note

that an individual parameter cannot span

multiple lines.

Response files can include comments lines that

begin with the # symbol.

You can specify multiple response files.

However, note that AzCopy does not support

nested response files.

   

/Y Suppresses all AzCopy confirmation prompts.

   

   

##

## Options - Applicable for Blob and Table Service Operations ##

##

   

   

/SourceSAS:<SAS-Token> Specifies a Shared Access Signature with READ

and LIST permissions for the source (if

applicable). Surround the SAS with double

quotes, as it may contains special command-line

characters.

If the source resource is a blob container,

and neither a key nor a SAS is provided, then

the blob container will be read via anonymous

access.

If the source is a table, a key or a SAS must

be provided.

   

/DestSAS:<SAS-Token> Specifies a Shared Access Signature (SAS) with

READ and WRITE permissions for the

destination (if applicable).

Surround the SAS with double quotes, as it may

contains special command-line characters.

If the destination resource is a blob

container or table, you can either specify this

option followed by the SAS token, or you can

specify the SAS as part of the destination blob

container or table's URI, without this option.

If the source and destination are both blobs,

then the destination blob must reside within

the same storage account as the source blob.

   

/SourceType:<blob | table> Specifies that the source resource is a blob

or table available in the local development

environment, running in the storage emulator.

   

/DestType:<blob | table> Specifies that the destination resource is a

blob or table available in the local

development environment, running in the

storage emulator.

   

   

##

## Options - Applicable for Blob and File Service Operations ##

##

   

   

/S Specifies recursive mode for copy operations.

In recursive mode, AzCopy will copy all blobs

or files that match the specified file

pattern, including those in subfolders.

   

/Pattern:<file-pattern> Specifies a file pattern that indicates which

files to copy.

   

The behavior of the /Pattern parameter is

determined by the location of the source data,

and the presence of the recursive mode option.

Recursive mode is specified via option /S.

   

If the specified source is a directory in

the file system, then standard wildcards are

in effect, and the file pattern provided is

matched against files within the directory.

If option /S is specified, then AzCopy also

matches the specified pattern against all

files in any subfolders beneath the directory.

   

If the specified source is a blob container or

virtual directory, then wildcards are not

applied. If option /S is specified, then AzCopy

interprets the specified file pattern as a blob

prefix. If option /S is not specified, then

AzCopy matches the file pattern against exact

blob names.

If the specified source is an Azure file share,

then you must either specify the exact file

name, (e.g. abc.txt) to copy a single file, or

specify option /S to copy all files in the

share recursively. Attempting to specify both a

file pattern and option /S together will result

in an error.

The default file pattern used when no file

pattern is specified is *.* for a file system

location or an empty prefix for an Azure

Storage location.

Specifying multiple file patterns is not

supported.

   

/CheckMD5 Calculates an MD5 hash for downloaded data and

verifies that the MD5 hash stored in the blob

or file's Content-MD5 property matches the

calculated hash. The MD5 check is turned off by

default, so you must specify this option to

perform the MD5 check when downloading data.

Note that Azure Storage doesn't guarantee that

the MD5 hash stored for the blob or file is

up-to-date. It is client's responsibility to

update the MD5 whenever the blob or file is

modified.

AzCopy always sets the Content-MD5 property for

an Azure blob or file after uploading it to the

service.

   

/L Specifies a listing operation only; no data is

copied.

   

/MT Sets the downloaded file's last-modified time

to be the same as the source blob or file's.

   

/XN Excludes a newer source resource. The resource

will not be copied if the source is newer than

destination.

   

/XO Excludes an older source resource. The resource

will not be copied if the source resource is

older than destination.

   

/A Uploads only files that have the Archive

attribute set.

/IA:[RASHCNETOI] Uploads only files that have any of the

specified attributes set.

Available attributes include:

R Read-only files

A Files ready for archiving

S System files

H Hidden files

C Compressed file

N Normal files

E Encrypted files

T Temporary files

O Offline files

I Not content indexed Files

   

/XA:[RASHCNETOI] Excludes files from upload that have any of the

specified attributes set.

Available attributes include:

R Read-only files

A Files ready for archiving

S System files

H Hidden files

C Compressed file

N Normal files

E Encrypted files

T Temporary files

O Offline files

I Not content indexed Files

   

/NC:<number-of-concurrent> Specifies the number of concurrent operations.

AzCopy by default starts a certain number of

concurrent operations to increase the data

transfer throughput.

Note that large number of concurrent operations

in a low-bandwidth environment may overwhelm

the network connection and prevent the

operations from fully completing. Throttle

concurrent operations based on actual available

network bandwidth.

The upper limit for concurrent operations is

512.

   

/SyncCopy Indicates whether to synchronously copy blobs

or files among two Azure Storage end points.

AzCopy by default uses server-side

asynchronous copy. Specify this option to

download the blobs or files from the service

to local memory and then upload them to the

service.

/SyncCopy can be used in below scenarios:

1) Copying from Blob storage to Blob storage.

2) Copying from File storage to File storage.

3) Copying from Blob storage to File storage.

4) Copying from File storage to Blob storage.

/SetContentType:[content-

type] Specifies the content type of the destination

blobs or files.

AzCopy by default uses

"application/octet-stream" as the content type

for the destination blobs or files. If option

/SetContentType is specified without a value

for "content-type", then AzCopy will set each

blob or file's content type according to its

file extension. To set same content type for

all the blobs, you must explicitly specify a

value for "content-type".

   

   

##

## Options - Only applicable for Blob Service Operations ##

##

   

   

/BlobType:<page | block> Specifies whether the destination blob is a

block blob or a page blob.

If the destination is a blob and this option

is not specified, then by default AzCopy will

create a block blob.

   

/Delimiter:<delimiter> Indicates the delimiter character used to

delimit virtual directories in a blob name.

By default, AzCopy uses / as the delimiter

character. However, AzCopy supports using any

common character (such as @, #, or %) as a

delimiter. If you need to include one of these

special characters on the command line, enclose

it with double quotes.

This option is only applicable for downloading

blobs.

   

/Snapshot Indicates whether to transfer snapshots. This

option is only valid when the source is a blob.

The transferred blob snapshots are renamed in

this format: [blob-name] (snapshot-time)

[extension].

By default, snapshots are not copied.

   

##

## Options - only applicable for Table Service Operations ##

##

   

   

/PKRS:<"key1#key2#key3#..."> Splits the partition key range to enable

exporting table data in parallel, which

increases the speed of the export operation.

If this option is not specified, then AzCopy

uses a single thread to export table entities.

For example, if the user specifies

/PKRS:"aa#bb", then AzCopy starts three

concurrent operations.

Each operation exports one of three partition

key ranges, as shown below:

[<first partition key>, aa)

[aa, bb)

[bb, <last partition key>]

   

/SplitSize:<file-size> Specifies the exported file split size in MB.

If this option is not specified, AzCopy will

export table data to single file.

If the table data is exported to a blob, and

the exported file size reaches the 200 GB limit

for blob size, then AzCopy will split the

exported file, even if this option is not

specified.

   

/EntityOperation:<InsertOrSkip

| InsertOrMerge

| InsertOrReplace> Specifies the table data import behavior.

InsertOrSkip - Skips an existing entity or

inserts a new entity if it does not exist in

the table.

InsertOrMerge - Merges an existing entity or

inserts a new entity if it does not exist in

the table.

InsertOrReplace - Replaces an existing entity

or inserts a new entity if it does not exist

in the table.

   

/Manifest:<manifest-file> Specifies the manifest file for the import

operation.

The manifest file was generated during the

export operation.

   

##

## Samples ##

##

   

   

#1 - Download a blob from Blob storage to the file system, for example,

download 'https://myaccount.blob.core.windows.net/mycontainer/abc.txt'

to 'D:\test\'

AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer/

/Dest:D:\test\ /SourceKey:key /Pattern:"abc.txt"

   

#2 - Copy a blob within a storage count

AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer1/

/Dest:https://myaccount.blob.core.windows.net/mycontainer2/

/SourceKey:key /DestKey:key /Pattern:"abc.txt"

   

#3 - Upload files and subfolders in a directory to a container, recursively

AzCopy /Source:D:\test\

/Dest:https://myaccount.blob.core.windows.net/mycontainer/

/DestKey:key /S

   

#4 - Upload files matching the specified file pattern to a container,

recursively.

AzCopy /Source:D:\test\

/Dest:https://myaccount.blob.core.windows.net/mycontainer/ /DestKey:key

/Pattern:*ab* /S

   

#5 - Download blobs with the specified prefix to the file system, recursively

AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer/

/Dest:D:\test\ /SourceKey:key /Pattern:"a" /S

   

#6 - Download files and subfolders in an Azure file share to the file system,

recursively

AzCopy /Source:https://myaccount.file.core.windows.net/mycontainer/

/Dest:D:\test\ /SourceKey:key /S

   

#7 - Upload files and subfolders from the file system to an Azure file share,

recursively

AzCopy /Source:D:\test\

/Dest:https://myaccount.file.core.windows.net/mycontainer/

/DestKey:key /S

   

#8 - Export an Azure table to a local folder

AzCopy /Source:https://myaccount.table.core.windows.net/myTable/

/Dest:D:\test\ /SourceKey:key

   

#9 - Export an Azure table to a blob container

AzCopy /Source:https://myaccount.table.core.windows.net/myTable/

/Dest:https://myaccount.blob.core.windows.net/mycontainer/

/SourceKey:key1 /Destkey:key2

   

#10 - Import data in a local folder to a new table

AzCopy /Source:D:\test\

/Dest:https://myaccount.table.core.windows.net/mytable1/ /DestKey:key

/Manifest:"myaccount_mytable_20140103T112020.manifest"

/EntityOperation:InsertOrReplace

   

#11 - Import data in a blob container to an existing table

AzCopy /Source:https://myaccount.blob.core.windows.net/mycontainer/

/Dest:https://myaccount.table.core.windows.net/mytable/ /SourceKey:key1

/DestKey:key2 /Manifest:"myaccount_mytable_20140103T112020.manifest"

/EntityOperation:InsertOrMerge

   

   

------------------------------------------------------------------------------

AzCopy의 보다 자세한 정보는 아래 사이트에서 확인 가능합니다.

http://aka.ms/azcopy.

------------------------------------------------------------------------------

   

감사합니다