# Commandline Compare issues?

**URL:** https://forum.duplicati.com/t/commandline-compare-issues/663
**Category:** Features
**Created:** [September 16, 2017, 5:09am UTC](https://forum.duplicati.com/t/commandline-compare-issues/663 "2017-09-16T05:09:56Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 16, 2017, 5:09am UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/1 "2017-09-16T05:09:56Z")

</div>

I’m trying to compare two backups (most recent to next most recent) to get an idea of what files were backed up in the most job. (In other words, why the heck was that last backup so big???)

I’m trying to use Compare (both in command line and GUI Commandline) but can’t seem to get it to work.

I’m running Duplicati as a service so from a command prompt (doesn’t seem to matter if it’s admin or not) I run:  
`C:\Program Files\Duplicati 2>Duplicati.CommandLine compare C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati\LBGGKLSPPC.sqlite`

But after entering the encryption passphrase it just spits out the following even though I know the file exists (used it to build the path parm):

> No local database, accessing remote store  
> Listing remote folder …  
> Operation List with file attempt 1 of 5 failed with message: The folder C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati\LBGGKLSPPC.sqlite does not exist =\> The folder C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati\LBGGKLSPPC.sqlite does not exist

If I remove the file name (how does it know which backup I want??) and try I get:

> No local database, accessing remote store  
> Listing remote folder …  
> Need at least two backups to show differences, database contains 0 backups  
> Update “2.0.2.5\_canary\_2017-09-14” detected

Under the assumption that I’m an idiot and the REMOTE local is all that it wants I tried:  
`Duplicati.CommandLine compare ssh://mySSH//mnt/user/Duplicati/TestBackup?auth-username=me&auth-password=mypassword&ssh-fingerprint=ssh-rsa%myfinger`

But only get:

> No local database, accessing remote store  
> Listing remote folder …  
> Operation List with file attempt 1 of 5 failed with message: String reference not set to an instance of a String.  
> Parameter name: s =\> String reference not set to an instance of a String.  
> Parameter name: s

I even reviewed Github but it didn’t clarify anything for me - what am I doing wrong in trying to see what changes happened in the most recent backup?

> <https://github.com/duplicati/duplicati/issues/1104>
>
> Currently, the only way I found to list available backup versions from an existi…ng backup job on the command line ist to use
> \`Duplicati.CommandLine find \<some\_file\_that\_definitely\_is\_in\_all\_Backups\> --all-versions\`
> 
> It would be very helpful to have an option like \`Duplicati.Commandline list \<Backup\_Job\>\` to show the available Backups.
> An Option \`--compare\` (to list the changes between Backups) would also quite helpful. Just like a \`Duplicati.CommandLine compare --verbose\` does - but for all Versions.
> 
> Currently GUI and command line refer to backup versions in different ways:
> \- When restoring a Backups in the GUI, you work with a timestamp
> \- When restoring a Backup on command line you use a counter ("0" is the most current Version, "1" is the next oldest ...)
> \- The fact that Backup "0" will become Backup "1" after re-running the Backup Job (but only if files have changed) makes it even more confusing. 
> 
> Adding something like \`Duplicati.Commandline list \<Backup\_Job\>\` could clear things up a lot.
> The last thing you would want is to do, is a \`Duplicati.Commandline delete\` on the wrong version ;)

---

<div class="post-metadata">

### Author: ![dgcom](https://forum.duplicati.com/user_avatar/forum.duplicati.com/dgcom/32/2711_2.png) [@dgcom](https://forum.duplicati.com/u/dgcom)
#### Post date: [September 16, 2017, 5:16am UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/2 "2017-09-16T05:16:41Z")

</div>

I think you got commandline parameters wrong - please run this to read more:

```
Duplicati.CommandLine.exe help
Duplicati.CommandLine.exe help compare
Duplicati.CommandLine.exe help advanced
etc.

```

The 2nd parameter for compare is storage URL and other parameters always start with – and use = to specify the value.  
Good way to learn proper command line is to export backup to commandline in web UI.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 16, 2017, 1:31pm UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/3 "2017-09-16T13:31:29Z")

</div>

I did read though Duplicati.CommandLine.exe help compare a few times already - and did again after your post in case I was missing something, but it still didn’t help.

The suggestion to review what an exported commandline looks like, however DID give me what I needed - QUOTES!

The parameter is expected to be in quotes!

So I can now review what was done in the most recent backup with:  
`Duplicati.CommandLine compare "ssh://mySSH:MyPort/mnt/user/Test?auth-username=<me>&auth-password=<myPass>&ssh-fingerprint=<myFinger>"`

Similarly, using the “Restore” UI to get a list of existing versions I can compare the most recent (0) to a backup from 7 days ago by adding the 3rd & 4th parameters:  
`Duplicati.CommandLine compare "ssh://mySSH:MyPort/mnt/user/Test?auth-username=<me>&auth-password=<myPass>&ssh-fingerprint=<myFinger>" 0 7`

Similarly, using the “Restore” UI to get a list of existing versions I can compare the most recent (0) to a backup from 7 days ago by adding the 3rd & 4th parameters:  
`Duplicati.CommandLine compare "ssh://mySSH:MyPort/mnt/user/Test?auth-username=<me>&auth-password=<myPass>&ssh-fingerprint=<myFinger>" 0 7`

And adding `--verbose` gets me the full listing instead of just a summary.

Oddly, I can’t seem to use the local database by referencing my local .sqlite (dbpath) file - are only remote folder based listings supported?

Equally oddly, I still can’t seem to get it to run from the Commandline UI.

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [September 16, 2017, 7:16pm UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/4 "2017-09-16T19:16:56Z")

</div>

> [@JonMikelV](#):
>
> The parameter is expected to be in quotes!

Not really, but if you do not have quotes, the shell tends to treat various characters to be escape characters (i.e. `&` and `?` have different meanings). Putting quotes around suppresses most escape characters, so the export routine always does it.

> [@JonMikelV](#):
>
> ```plaintext
> No local database, accessing remote store
> 
> Listing remote folder …
> 
> Operation List with file attempt 1 of 5 failed with message: The folder C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati\LBGGKLSPPC.sqlite does not exist =&gt; The folder C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati\LBGGKLSPPC.sqlite does not exist
> 
> ```

As pointed out by @dgcom it thinks the second parameter is the target url, and since you supply a filename, it thinks you are pointing to a folder.

> [@JonMikelV](#):
>
> If I remove the file name (how does it know which backup I want??) and try I get:
> 
> ```plaintext
> No local database, accessing remote store
> Listing remote folder …
> Need at least two backups to show differences, database contains 0 backups
> Update “2.0.2.5_canary_2017-09-14” detected
> 
> ```

Yes, that does sound strange, it should say something like “invalid number of arguments”.

> [@JonMikelV](#):
>
> But only get:
> 
> ```plaintext
> No local database, accessing remote store
> Listing remote folder …
> Operation List with file attempt 1 of 5 failed with message: String reference not set to an instance of a String.
> Parameter name: s =&gt; String reference not set to an instance of a String.
> Parameter name: s
> 
> ```

Can you try again with `--debug-output --verbose`, I would like to see where the crash happens so we can give a better error message.

> [@JonMikelV](#):
>
> Oddly, I can’t seem to use the local database by referencing my local .sqlite (dbpath) file - are only remote folder based listings supported?

That should work with `--dbpath=...` ?

> [@JonMikelV](#):
>
> Equally oddly, I still can’t seem to get it to run from the Commandline UI.

If you open the commandline UI, you should be able to keep the `--dbpath` parameter, and clear the rest, except the target url. Then in the “arguments” field type `0` and `7` on two lines.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 17, 2017, 2:04am UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/5 "2017-09-17T02:04:56Z")

</div>

> [@kenkendk](#):
>
> As pointed out by @dgcom it thinks the second parameter is the target url, and since you supply a filename, it thinks you are pointing to a folder.

Ah, I see now - I didn’t understand how the parameters where used and incorrectly assumed the second parameter was purely to point to somewhere with backup info (such as destination OR dbpath). Indeed ADDING `–dbpath=“C:\xxxxx\ABCDEF.sqlite” as the 3rd parameter sped it up and removed the “Listing remote folder” message. Yay!

* * *

> [@kenkendk](#):
>
> Can you try again with --debug-output --verbose, I would like to see where the crash happens so we can give a better error message.

Sure thing!

> **Summary**
>
> ```plaintext
> duplicati.commandline compare C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati\ --debug-output --verbose
> 
> Input command: compare
> Input arguments:
> C:\Windows\System32\config\systemprofile\AppData\Local\Duplicati\
> 
> Input options:
> debug-output:
> verbose:
> 
> Enter encryption passphrase: **********
> No local database, accessing remote store
> Listing remote folder ...
> 
> Duplicati.Library.Interface.UserInformationException: Need at least two backups to show differences, database contains 0 backups
> at Duplicati.Library.Main.Operation.ListChangesHandler.Run(String baseVersion, String compareVersion, IEnumerable`1 filterstrings, IFilter compositefilter, Action`2 callback)
> at Duplicati.Library.Main.Controller.<>c __DisplayClass31_0.<ListChanges>b__ 0(ListChangesResults result)
> at Duplicati.Library.Main.Controller.RunAction[T](T result, String[]& paths, IFilter& filter, Action`1 method)
> at Duplicati.CommandLine.Commands.ListChanges(TextWriter outwriter, Action`1 setup, List`1 args, Dictionary`2 options, IFilter filter)
> at Duplicati.CommandLine.Program.RunCommandLine(TextWriter outwriter, TextWriter errwriter, Action`1 setup, String[] args)
> 
> Update "2.0.2.6_canary_2017-09-16" detected
> 
> ```

* * *

> [@kenkendk](#):
>
> If you open the commandline UI, you should be able to keep the --dbpath parameter, and clear the rest, except the target url. Then in the “arguments” field type 0 and 7 on two lines.

Huzzah! I understand now how the Commandline UI works, thank-you!

While using the “dbpath” Advanced Option worked, for me what worked BEST was to put everything in the “Commandline Arguments” field, then use “Edit as text” to remove ALL “Advanced options” (leaving any in seemed to cause unexpected results).  
 ![image](https://forum.duplicati.com/uploads/default/original/1X/176c2f711baaa48802dcc7bf47aa1c09132c5767.png)

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [September 18, 2017, 8:50am UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/6 "2017-09-18T08:50:27Z")

</div>

> [@JonMikelV](#):
>
> Can you try again with --debug-output --verbose, I would like to see where the crash happens so we can give a better error message.
> 
> Sure thing!

That does not give the error with `Parameter name: s`. According to your original post, the command the produced it was:

```plaintext
Duplicati.CommandLine compare ssh://mySSH//mnt/user/Duplicati/TestBackup?auth-username=me&auth-password=mypassword&ssh-fingerprint=ssh-rsa%myfinger

```

I tried that on my machine, and it did not give the error message.

> [@JonMikelV](#):
>
> Huzzah! I understand now how the Commandline UI works, thank-you!

Awesome!

> [@JonMikelV](#):
>
> While using the “dbpath” Advanced Option worked, for me what worked BEST was to put everything in the “Commandline Arguments” field, then use “Edit as text” to remove ALL “Advanced options” (leaving any in seemed to cause unexpected results).

Yes, there is some overlap in the arguments and options. If you know what you want, it is easier to just use the “commandline arguments” field. For lack of time I skimped on the argument splitting and just use each line as an argument, but maybe we should fix that so it works like a normal commandline where spaces also delimit arguments.

---

<div class="post-metadata">

### Author: ![JonMikelV](https://forum.duplicati.com/letter_avatar_proxy/v4/letter/j/439d5e/32.png) [@JonMikelV](https://forum.duplicati.com/u/JonMikelV)
#### Post date: [September 19, 2017, 10:05pm UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/7 "2017-09-19T22:05:04Z")

</div>

It looks like the issue is not having quotes around the “ssh://” causes a parsing issue in the parmeters.

This exact command (nothing obfuscated) recreates the issue (put anything but blank in for the passphrase).

```
"C:\Program Files\Duplicati 2\Duplicati.CommandLine.exe" compare ssh://a

Enter encryption passphrase: *
No local database, accessing remote store
  Listing remote folder ...
Operation List with file attempt 1 of 5 failed with message: String reference not set to an instance of a String.
Parameter name: s => String reference not set to an instance of a String.
Parameter name: s
  Listing remote folder ...
Operation List with file attempt 2 of 5 failed with message: String reference not set to an instance of a String.
Parameter name: s => String reference not set to an instance of a String.
Parameter name: s
...

```

---

<div class="post-metadata">

### Author: ![kenkendk](https://forum.duplicati.com/user_avatar/forum.duplicati.com/kenkendk/32/5305_2.png) [@kenkendk](https://forum.duplicati.com/u/kenkendk)
#### Post date: [September 20, 2017, 8:17pm UTC](https://forum.duplicati.com/t/commandline-compare-issues/663/8 "2017-09-20T20:17:04Z")

</div>

> [@JonMikelV](#):
>
> This exact command (nothing obfuscated) recreates the issue

Ok, I’ve found it. It is the SSH library that expects either a key or a password, but gets a null password and that throws the rather cryptic error message.
