Omit uploaded files with AzCopy
Asked Answered
F

3

8

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

Fiver answered 27/11, 2014 at 15:27 Comment(1)
Is there a particular reason you would want to omit these files? I'm curious to know that. How big are these files?Chartist
P
13

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
Premolar answered 6/4, 2020 at 14:43 Comment(0)
W
3

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

Weltanschauung answered 17/5, 2017 at 13:47 Comment(1)
To anyone finding this today - this is the older version of AzCopy learn.microsoft.com/en-us/previous-versions/azure/storage/… This syntax won't work on the new version at learn.microsoft.com/en-us/azure/storage/common/…Khalsa
R
2

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

Rienzi answered 9/1, 2015 at 9:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.