Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tell AzCopy batch to overwrite files?

So I'm using an AzCopy which is run manually at the moment but I was to run it through Task Scheduler on one of our servers. This copies files from one container to another and runs perfectly if I manually execute the batch file. However, it asks me:

Overwrite https://.file.core.windows.net// with https://.file.core.windows.net//? (Yes/No/All)

Now this is all great and if I click Yes or All is proceeds with no problems. But if it is scheduled, I loose the ability to click Yes/All and then it hits timeout?

Is there a way or something I'm missing to allow it to continue through this please?

Thanks in advance!

like image 853
Josh Reynolds Avatar asked Jul 03 '17 13:07

Josh Reynolds


People also ask

How do I copy multiple files using AzCopy?

Specify multiple complete file namesUse the azcopy copy command with the --include-path option. Separate individual file names by using a semicolon ( ; ). In this example, AzCopy transfers the C:\myDirectory\photos directory and the C:\myDirectory\documents\myFile. txt file.

What is recursive AzCopy?

Recursive Copy of AzCopy appends the source directory you specified to dest. For example, the following command requires a container named abc to exist in the storage account, or the command fails. Another example, the following command results in a directory named abc inside of the abc container.

Can AzCopy move files?

AzCopy is a command-line utility that you can use to copy blobs or files to or from a storage account. This article helps you download AzCopy, connect to your storage account, and then transfer data. AzCopy V10 is the currently supported version of AzCopy.


2 Answers

For version 10, the default behavior is to overwrite without prompt and this can be controlled by the --overwrite flag (default 'true').

Overwrite the conflicting files and blobs at the destination if this flag is set to true. (default 'true') Possible values include 'true', 'false', 'prompt', and 'ifSourceNewer'. For destinations that support folders, conflicting folder-level properties will be overwritten this flag is 'true' or if a positive response is provided to the prompt. (default "true")

See also the azcopy copy page for reference.

like image 107
Jay Cummins Avatar answered Sep 20 '22 17:09

Jay Cummins


Please try it with /Y option. From AzCopy Parameters:

/Y

Suppresses all AzCopy confirmation prompts.

like image 32
Gaurav Mantri Avatar answered Sep 20 '22 17:09

Gaurav Mantri