2
votes

I am working on a backup solution for our blob storage. One of the requirements is being able to do a partial backup (will be used for test environments), where I'd only take the last ~1000 blobs that were uploaded to the storage and copy to the other storage account. Our blobs are just named as numbers 1, 2, ..., 756479,...

I currently cannot see parameter that would 'take last x blobs' in AzCopy..

I have tried to specify /Pattern parameter, but that does NOT seem to support this /Pattern: 756* It does not copy the blob named 756479. It only works as a prefix, without the *, which would match unwanted blobs, such as 756, 7560, 75612...

Could someone clarify whether real regex pattern matching is possible in AzCopy, or how could I solve this issue?

1
Do you mean the vhd names are numbers only ? U have different different containers for blobs or you are heaping all blobs under same storage ?Aatif Akhter
Not sure what you mean. It's a simple blob storage, for our pdfs, excel files etc. renamed to just an integer. They are all in one container. I want to make a backup of these, to a different blob storage account with the same container name.akrobet

1 Answers

2
votes

No, AzCopy doesn't support regex pattern matching when source is blob, as the blob service only supports prefix blob query. And unfortunately, there isn't an option in AzCopy to specify "last" N blobs.

If you would like to implement an incremental backup mechanism, perhaps you can check whether option /XO fits your requirement:

Excludes an older source resource. The resource will not be copied if the source resource is older than destination.

For further details of AzCopy, please refer to http://aka.ms/azcopy.