Exclude changed folders from compare result


how can I exclude folders when using compare command? It seems that folders are included because some metadata on them changed (modification date). For example, when I modify test.txt in folder testFolder, the compare will show that testFolder was modified and testFolder\test.txt was modified. I don’t care about folder modification, it seems of no value, just noise.

Thank you for Duplicati and your support.

Kind regards, Jan

BTW, using --exclude=“c:*\” throws
System.Data.SQLite.SQLiteException (0x80004005): SQL logic error or missing data base near ""."": syntax error

I think \" is treated as an escape for just a literal ".
Maybe you can do something like:


If I try to include --exclude= with a compare command I get a SQL logic error.

The command works fine (though including folders) if I remove the exclusion.

"C:\Duplicati\Duplicati.CommandLine.exe" compare "ssh://mySSH:12345//mnt/Duplicati?auth-username=me&auth-password=myPass&ssh-fingerprint=myFinger" --dbpath="C:\Duplicati\CMYDPURRBS.sqlite" --verbose --exclude="*\\"
Input command: compare
Input arguments:

Input options:
dbpath: C:\Duplicati\CMYDPURRBS.sqlite

System.Data.SQLite.SQLiteException (0x80004005): SQL logic error or missing databasenear ""."": syntax error
   at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
   at Duplicati.Library.Main.Database.ExtensionMethods.ExecuteReader(IDbCommandself, String cmd, Object[] values)
   at Duplicati.Library.Main.Database.LocalListChangesDatabase.StorageHelper.AddFromDb(Int64 filesetId, Boolean asNew, IFilter filter)
   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`1setup, List`1 args, Dictionary`2 options, IFilter filter)
   at Duplicati.CommandLine.Program.RunCommandLine(TextWriter outwriter, TextWriter errwriter, Action`1 setup, String[] args)

It seems to crash no matter what you write in --exclude or --include. I could be mistaken but looking through Git code in LocalListChangesDatabase.cs, method AddFromDb() it seems that there are excessive quotes around inner select in:

using(var rd = cmd.ExecuteReader(string.Format(@“SELECT ““A””.”“Path”", ““A””."“FileHash”", ““A””."“MetaHash”", ““A””."“Size”", ““A””."“Type”" FROM “”{0}"" A WHERE ““A””."“FilesetID”" = ?", combined), filesetId))

Should I report a bug?

Kind regard, Jan

Good catch! Yes, if you make a PR I will merge it.

I would like to but I cannot build/debug or otherwise verify the change, I am Java guy. I will happily leave the fame of fixing this bug to someone else :slight_smile:

Ok, I fixed it: