Closed chaim1221 closed 5 years ago
I'm not sure if this is the best place to ask (I don't have access to Azure, so I'm not able to test anything), but let's try to answer your question!
The correct syntax of the BACKUP
command can be found here. The Storage Provider section gives an overview of all supported backends and some options that are specific for each backend, not how to use the BACKUP
command.
Syntax for BACKUP
is
Duplicati.CommandLine.exe backup <storage-URL> "<source-path>" [<options>]
username
must not contain :
and password must not contain @
. If they do, specify username and password using --auth-username
and --auth-password
, or url-encode them.
so your command could look something like:
docker exec -u 0 -it duplicati duplicati-cli backup "azure://containerbackuptest/?auth-username=accountname&auth-password=passkey" "/databases"
The specified containername must be an existing container. Because Duplicati Always makes an incremental backup and references to already uploaded data, you should not use variables (date) in the destination path.
Another suggestion: add a backup job using the Duplicati Web UI. Do not schedule the backup in step 4. After the backup is configured, export the config to the commandline.
Please let me know if this helped you out. If you have additional questions, I guess the Duplicati forum is the best place to ask.
Thanks! Yes the documentation does imply that the syntax is
Duplicati.CommandLine.exe backup <storage-URL> "<source-path>" [<options>]
but nowhere does it say anything about making those options part of a URI string. The documentation should be updated to indicate the proper syntax because the two sources you mentioned will leave people at the same conclusion that I came to, which is that the options should come last.
Re: Incremental backups, thanks. Of course we might want to take a complete backup fairly frequently but I will figure that part out.
Re: Web UI, we are configuring this with Chef, so I don't think that will work for our purposes. But thanks!
I was also unaware of the forum, so I'll look there for further tidbits.
Thanks again!
I tried asking in the forums and received no response.
The example command did not work.
I need real working examples of using Azure blob storage with Duplicati backups. Do those exist?
Thanks.
Sorry to hear you didn't get it working. I can't test anything, because I don't have access to Azure. I'm afraid not many Azure users will read this, the Duplicati forum has more activity and has a lot more members. But I'll give it a try to help you.
Did you try to use the GUI and export a backup job configuration from there? The GUI has a button to test the connection, this is very handy to check if you entered your credentials correctly.
Assuming that:
containerbackuptest
machetebackuptest
123!@#$%^&*()456
123@#$456
Then the exported Duplicati backup command looks something like this:
duplicati-cli backup "azure://containerbackuptest?auth-username=machetebackuptest&auth-password=123!%40%23%24%25%5E%26*()456" "D:\Sourcefolder" --backup-name=Testbackup --passphrase="123@#$%456"
So it looks like the access key can be entered using the password
option in the destination url and should be URL encoded. The passphrase doesn't have to be encoded, but should be enclosed in quotes if it contains one or more special characters.
Hope this helps, let me know if there's any news.
Oh my goodness I didn't even see this response thank you so much! I will let you know if this works and if it does I'll try to add a HOWTO in the forums.
Here is the result of the exported command...
Backup started at 04/28/2019 22:07:59
Checking remote backup ...
Listing remote folder ...
Listing remote folder ...
Listing remote folder ...
Listing remote folder ...
Listing remote folder ...
Fatal error => Error: NameResolutionFailure
Microsoft.WindowsAzure.Storage.StorageException: Error: NameResolutionFailure ---> System.Net.WebException: Error: NameResolutionFailure
at System.Net.WebConnection.Connect (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x00044] in <9b672a45b19f4d52b5f28f32c0c91d97>:0
at System.Net.WebConnection.InitConnection (System.Net.WebOperation operation, System.Threading.CancellationToken cancellationToken) [0x000cc] in <9b672a45b19f4d52b5f28f32c0c91d97>:0
at System.Net.WebOperation.Run () [0x0009a] in <9b672a45b19f4d52b5f28f32c0c91d97>:0
at System.Net.WebCompletionSource`1[T].WaitForCompletion () [0x00094] in <9b672a45b19f4d52b5f28f32c0c91d97>:0
at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Task`1[TResult] workerTask, System.Int32 timeout, System.Action abort, System.Func`1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x000f8] in <9b672a45b19f4d52b5f28f32c0c91d97>:0
at System.Net.HttpWebRequest.GetResponse () [0x00016] in <9b672a45b19f4d52b5f28f32c0c91d97>:0
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.ExecuteSync[T] (Microsoft.WindowsAzure.Storage.Core.Executor.RESTCommand`1[T] cmd, Microsoft.WindowsAzure.Storage.RetryPolicies.IRetryPolicy policy, Microsoft.WindowsAzure.Storage.OperationContext operationContext) [0x00242] in <c69bf8bb7e9f4ff3a055a52f661f6fcd>:0
--- End of inner exception stack trace ---
at Duplicati.Library.Main.BackendManager.List () [0x00049] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.Library.Main.Operation.FilelistProcessor.RemoteListAnalysis (Duplicati.Library.Main.BackendManager backend, Duplicati.Library.Main.Options options, Duplicati.Library.Main.Database.LocalDatabase database, Duplicati.Library.Main.IBackendWriter log, System.String protectedfile) [0x0000d] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.Library.Main.Operation.FilelistProcessor.VerifyRemoteList (Duplicati.Library.Main.BackendManager backend, Duplicati.Library.Main.Options options, Duplicati.Library.Main.Database.LocalDatabase database, Duplicati.Library.Main.IBackendWriter log, System.String protectedfile) [0x00000] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.Library.Main.Operation.BackupHandler.PreBackupVerify (Duplicati.Library.Main.BackendManager backend, System.String protectedfile) [0x0010d] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.Library.Main.Operation.BackupHandler.RunAsync (System.String[] sources, Duplicati.Library.Utility.IFilter filter) [0x01031] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at CoCoL.ChannelExtensions.WaitForTaskOrThrow (System.Threading.Tasks.Task task) [0x00050] in <6973ce2780de4b28aaa2c5ffc59993b1>:0
at Duplicati.Library.Main.Operation.BackupHandler.Run (System.String[] sources, Duplicati.Library.Utility.IFilter filter) [0x00008] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.Library.Main.Controller+<>c__DisplayClass13_0.<Backup>b__0 (Duplicati.Library.Main.BackupResults result) [0x00035] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.Library.Main.Controller.RunAction[T] (T result, System.String[]& paths, Duplicati.Library.Utility.IFilter& filter, System.Action`1[T] method) [0x00271] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.Library.Main.Controller.Backup (System.String[] inputsources, Duplicati.Library.Utility.IFilter filter) [0x00068] in <c6c6871f516b48f59d88f9d731c3ea4d>:0
at Duplicati.CommandLine.Commands.Backup (System.IO.TextWriter outwriter, System.Action`1[T] setup, System.Collections.Generic.List`1[T] args, System.Collections.Generic.Dictionary`2[TKey,TValue] options, Duplicati.Library.Utility.IFilter filter) [0x00119] in <04206d56f2084515b87543fcb90a7e00>:0
at (wrapper delegate-invoke) System.Func`6[System.IO.TextWriter,System.Action`1[Duplicati.Library.Main.Controller],System.Collections.Generic.List`1[System.String],System.Collections.Generic.Dictionary`2[System.String,System.String],Duplicati.Library.Utility.IFilter,System.Int32].invoke_TResult_T1_T2_T3_T4_T5(System.IO.TextWriter,System.Action`1<Duplicati.Library.Main.Controller>,System.Collections.Generic.List`1<string>,System.Collections.Generic.Dictionary`2<string, string>,Duplicati.Library.Utility.IFilter)
at Duplicati.CommandLine.Program.ParseCommandLine (System.IO.TextWriter outwriter, System.Action`1[T] setup, System.Boolean& verboseErrors, System.String[] args) [0x00313] in <04206d56f2084515b87543fcb90a7e00>:0
at Duplicati.CommandLine.Program.RunCommandLine (System.IO.TextWriter outwriter, System.IO.TextWriter errwriter, System.Action`1[T] setup, System.String[] args) [0x00002] in <04206d56f2084515b87543fcb90a7e00>:0
Request Information
RequestID:
RequestDate:
StatusMessage:
Unfortunately I'm not able to reproduce or test this, due to lack of access to Azure.
What I can see from the output, is that Duplicati unsuccessfully has tried 5 times to get a list of backup files at the remote location (Listing remote folder ...
) and gave up.
The NameResolutionFailure indicates that something in the URL is incorrect.
It looks like something goes wrong while connecting or authenticating to Azure.
When clicking the "Test connection" button in the GUI, did you get the "Connection works!" message?
There hasn't been any update on this issue for more than a month. Assuming this issue is solved. Otherwise, I'm afraid I can't help you any further. If you still have questions or want additional support, please post it in the Duplicati forums.
https://duplicati.readthedocs.io/en/latest/05-storage-providers/#azure-blob
I have tried these commands:
results in "System.IO.IOException: The source folder sillybackuptest does not exist, aborting backup"
results in "The supplied option --azure_account_name is not supported and will be ignored" and "System.IO.IOException: The source folder azure://containerbackuptest/2019-04-16 does not exist, aborting backup".
An example would be great, you know, an actual command you can run to put something in a blob container.
(I should note that it works fine for just making a file backup.)