Omit uploaded files with AzCopy

11.4k views Asked by At

I have uploaded with Cloudberry Explorer some files/folders to my Azure container but now I'm gonna change Cloudberry for AzCopy.

What I need is to omit those uploaded files. I don't know if can be done with a AzCopy parameter. the files to be uploaded are stored in a server so doing it manually is impossible due for are thousands of thousands of files/folders.

thanks in advance

3

There are 3 answers

1
Abhishek On

Use /XO flag in the command. It will not copy/replace old files. Sample command,

AzCopy /Source:C:\myfolder /Dest:https://myaccount.blob.core.windows.net/mycontainer /DestKey:key /XO

0
EthanX On

As it is documented in azcopy reference

--overwrite string Overwrite the conflicting files and blobs at the destination if this flag is set to true. Possible values include 'true', 'false', 'ifSourceNewer', and 'prompt'. (default "true")

So something like this should work:

azcopy.exe copy "source location" "destination location" --overwrite=false
0
Zhiming Yuan - Microsoft On

If the files uploaded by another tool has different naming convention with the new ones, you could use option /Pattern to upload only the new files,

e.g. old files have naming convention like “abcxxxx”, new files have naming convention like “xyzxxx”, then please specify /Pattern:xyz* to copy the new files only.

Or use option /xo (means exclude old files) to copy new files only, note that AzCopy will compare local files' change time with the 'Last Modified Time' of the destination blobs when you specified option /xo and /xn, please make sure the uploaded old files’ ‘Last modified time’ is same or newer than the their local copies’ change time, otherwise the old files will be uploaded again when you specified option /xo. You can use option /MT to set ‘Last Modified Time’ as same as local copies’ change time during upload.

For more details, please visit http://aka.ms/azcopy

Thanks