Configure SQLBackupAndFTP NLog

Configure SQLBackupAndFTP NLog
If you encounter a situation in which you run a job to backup your database to Dropbox for example or to another storage service you get an error saying: SBFDS5006″: Dropbox exception > Failed to upload file”; “Status: 0. Description: The operation was cancelled
Although the application might try multiple times to run this job, but without success.

First of all, to solve the issue, make sure that you have installed SQLBackupAndFTP version 9.1.10 or higher.

If the problem still persists, please do the following steps, as explained in the below section of how to configure SQLBackupAndFTP NLog.

Configure SQLBackupAndFTP NLog

Save the below XML code into a file called NLog.config and put the file in the same folder as your SQLBackupAndFTP installation (by default it’s: C:\Program Files (x86)\Pranas.NET\SQLBackupAndFTP).

There are fileName and archiveFileName attributes to specify a folder with log files.

You should configure SQLBackupAndFTP NLog.config file to be something like:

<?xml version="1.0" encoding="utf-8"?>

<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <!-- 
  See http://nlog-project.org/wiki/Configuration_file 
  for information on customizing logging rules and outputs.
   -->

  <targets>
    <!-- add your targets here -->

    <target xsi:type="AsyncWrapper" name="File">
      <target xsi:type="File" name="logFile" fileName="D:\Log\SQLBackupAndFTP\Current\SBF.log"
                  layout="${longdate}|${level:uppercase=true}|${threadid}|${logger}|${message}${onexception:|${exception:format=tostring}}"
              archiveFileName="D:\Log\SQLBackupAndFTP\Archives\log.{#}.txt"
              archiveEvery="Day"
              archiveNumbering="Rolling"
              maxArchiveFiles="7"
              concurrentWrites="true"
              keepFileOpen="false" />
    </target>
  </targets>

  <rules>
    <!-- add your logging rules here -->
    <logger name="*" minlevel="Trace" writeTo="File" />
  </rules>
</nlog>

After you finished configuring the SQLBackupAndFTP NLog file, save it in your folder, run the job again, and in case you receive any errors then please check the log file for records that start with “Request: Committing the upload” or “Request: File uploaded”.

Dropbox’s service cancels when uploading a file with chunks, so please try to connect to your Dropbox account with a new token. Go to SQLBackupAndFTP and open the job, remove the existing Dropbox destination, add it again and connect to your Dropbox account then try to run the job again.

By following the above instructions, to configure the SQLBackupAndFTP NLog file and re-connecting to your Dropbox account, you should have at this point solved the issue. Please try and run the job now and in case you still encounter errors, please post a comment on this article with the error you are getting or contact us through the form available at: http://sqlbackupandftp.com/contact/

Leave a Reply

Your email address will not be published. Required fields are marked *