Commit Graph
285 Commits
Author SHA1 Message Date
Kenneth Hsu ab489d9a28 Make parameter names in XML documentation match code. 2017-12-09 18:42:30 -08:00
Kenneth Hsu 1c7391399d Remove XML documentation for unmatched parameters. 2017-12-09 18:30:01 -08:00
Kenneth SkovhedeandGitHub 36aadc4ad1 Merge pull request #2910 from warwickmm/refactor/remove_redundant_tostring
Remove redundant calls to ToString
2017-11-27 08:50:00 +01:00
Kenneth Hsu 5fb1958ceb Remove redundant calls to ToString. 2017-11-26 15:44:34 -08:00
Kenneth Hsu 8810e0130d Make string comparisons use ordinal (binary) sort rules.
These string comparisons should not be culture-aware.
2017-11-26 11:19:54 -08:00
Roberto Ribeiro 1ce4ccd61f Changed subqueries to improve folder browsing in restore 2017-11-15 15:16:25 -02:00
Kenneth Hsu 604b6e4337 Dispose enumerators after manually iterating over elements.
Since the IEnumerator<T> interface implements IDisposable, we should
make sure to dispose of the enumerator when manually iterating over the
elements.
2017-10-07 12:27:11 -07:00
Kenneth SkovhedeandGitHub 1df44989d2 Update LocalListChangesDatabase.cs
Fixed issue with filters and ListCchanges / Compare
2017-10-03 11:08:43 +02:00
Kenneth Hsu 0738c5b624 Remove unnecessary call to String.Format. 2017-09-26 20:43:27 -07:00
Kenneth Hsu 4edf8536da Remove unused argument in string formatting. 2017-09-26 19:56:29 -07:00
Kenneth Hsu b84e7bd34d Avoid hard-coded parameter names.
This makes it easier to rename the parameter in the future as we don't
have to search for the parameter name within strings.
2017-09-25 19:54:54 -07:00
Kenneth Hsu e9ffc2cbe1 Add clearer exception message. 2017-09-25 19:54:54 -07:00
Kenneth Skovhede 6d401fbd8d Changed all hash algorithms to use the Cng version.
This fixes #2621
2017-09-20 09:58:43 +02:00
Kenneth Skovhede 4a6bf3deba Added "DeleteGraceTime" to all files deleted from the backend mananger.
This should fix a number of cases where the backup returns a consistency error because the deletion and the backend check happens before the backend is in sync.
2017-09-18 11:53:50 +02:00
Kenneth Skovhede 7d3ac25426 Re-introduced the in-memory block-cache. This time keeping it simple with a check for size-induced collisions. 2017-09-16 18:44:25 +02:00
Dan Stahr 7c9b2fcd83 Fixed missed vacuum reference. 2017-08-04 12:26:15 +01:00
Dan Stahr 58a95e03e6 Autovacuum option added 2017-08-04 12:09:01 +01:00
Kenneth Skovhede c5de213635 Added the unique constraint.
This fixes #2302
This fixes #2537
2017-06-15 10:07:58 +02:00
Kenneth Skovhede f1793b82dd Merge branch 'master' of https://github.com/zed9h/duplicati into zed9h-master 2017-06-15 09:54:28 +02:00
Oliver Kötter 49b43a00d0 Stop iterating though the path if remaining path is \\
Fixes crash when restoring files backuped from unc paths 

Fixes #2469
2017-06-07 08:24:09 +02:00
Kenneth SkovhedeandGitHub a8fe193f1e Merge pull request #2507 from downpoured/master
Proposed fix, --deleted-files causes Fatal error / System.FormatException
2017-05-30 00:53:18 +02:00
Ben Fisher 76f3769f70 Proposed fix, --deleted-files causes Fatal error / System.FormatException
A simple backup that specifies --deleted-files causes a Fatal error.
Shortened repro steps:
(See Github comment for full repro steps)
>duplicati.commandline.exe backup file://C:\data\local\testchangedfiles\destination "C:\data\local\testchangedfiles\source\\" --encryption-module="none" --no-encryption="true" --dbpath="testchangedfiles.sqlite"  --compression-module="zip" --keep-versions=-1  --no-auto-compact="true"
>del source\file6.txt
>duplicati.commandline.exe backup file://C:\data\local\testchangedfiles\destination "C:\data\local\testchangedfiles\source\\" --changed-files="C:\data\local\testchangedfiles\source\file1.txt;C:\data\local\testchangedfiles\source\file2.txt" --deleted-files="C:\data\local\testchangedfiles\source\file6.txt" --encryption-module="none" --no-encryption="true"  --dbpath="testchangedfiles.sqlite"  --compression-module="zip" --keep-versions=-1  --no-auto-compact="true"

Results in:
Fatal error => Input string was not in a correct format.
System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber
   at System.Number.ParseInt64
   at System.String.System.IConvertible.ToInt64
   at System.Convert.ToInt64
   at System.Data.SQLite.SQLiteStatement.BindParameter
   at System.Data.SQLite.SQLiteStatement.BindParameters
   at System.Data.SQLite.SQLiteCommand.BuildNextCommand
   at System.Data.SQLite.SQLiteCommand.GetStatement
   at System.Data.SQLite.SQLiteDataReader.NextResult
   at System.Data.SQLite.SQLiteDataReader..ctor
   at System.Data.SQLite.SQLiteCommand.ExecuteReader
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery
   at Duplicati.Library.Main.Database.LocalBackupDatabase.AppendFilesFromPreviousSet
   at Duplicati.Library.Main.Database.LocalBackupDatabase.AppendFilesFromPreviousSet
   at Duplicati.Library.Main.Operation.BackupHandler.RunMainOperation
   at Duplicati.Library.Main.Operation.BackupHandler.Run
   at Duplicati.Library.Main.Controller.RunAction[T]
   at Duplicati.Library.Main.Controller.Backup
   at Duplicati.CommandLine.Commands.Backup
   at Duplicati.CommandLine.Program.RunCommandLine
>Exit code: 100

With this patch, backup completes successfully.
2017-05-28 16:01:18 -07:00
Kenneth Skovhede 6cadaad56a Rewrote the query to use CROSS JOIN to force the SQLite query planner to consider the File table first. 2017-05-19 08:07:39 +02:00
Kenneth Skovhede d9014ee09c Changed query as suggested by @sjonez in issue #2442.
This fixes #2442.
2017-05-18 23:40:24 +02:00
Kenneth Skovhede fd14c1649b Fixed the query used to search for files.
This fixes #2471
2017-05-17 11:00:43 +02:00
Carlo "zED" Caputo 3e0447f342 Faster database recreation 2017-04-11 16:20:42 -03:00
Dan Stahr 27c9e15875 Improved database performance and logging
- Don't use Vacuum() just before PurgeLogData (which performs vacuum() already)
 - Removed unncessary poorly performning query (after optimizing it I found out it's unused)
 - Correctly log calls for ExecuteScalarInt64
2017-03-23 15:22:58 +00:00
Dan Stahr af14151d91 Fixed an error in renaming absolute Windows paths.
Previously, the output of the first replace was never used and therefore the absolute Windows paths were not restored
correctly.

The two patterns (i.e. ?: and \\) are disjoint so rewriting the previous result in case a match is found
for the second one is OK.
2017-03-10 22:01:24 +00:00
Kenneth Skovhede 5919309da9 Added additional checks to attempt to gather information from the remote destination, if the local database is somehow missing the size or hash 2017-02-27 00:43:06 +01:00
Kenneth Skovhede 9fd0121142 Removing the code that updates the logdata, as it has no effect, since any updated error messages will be destroyed later, should they contain any path-like strings.
This should help with #2298
2017-02-02 22:23:54 +01:00
Kenneth Skovhede 7f4c9383c3 Merge branch 'feature/set_tempdir_for_sqlite' 2017-01-25 21:16:45 +01:00
Kenneth Skovhede 0ad55a1ef2 Merge branch 'master' into feature/improved_consistency_check 2017-01-19 14:06:42 +01:00
Kenneth Skovhede d08b7750f0 Removed the unnecessary distinct clause from the recreate query.
Added a comment about the potentially unnecessary extra join in the statements that fills in block hashes.
2017-01-19 10:53:32 +01:00
Kenneth Skovhede 305d8bc7fe Added an extra condition on the join for the recreate issue.
This is a less experimental rewrite of the query that fixes the exact problem.
The speedups from this query fix are also substantial, going from 2.5 hours to 11 minutes.

This is likely a fix to these issues:
#1699, #2048, #2140, #2178

This could help with issues:
#1391, #2050
2017-01-19 09:55:36 +01:00
Kenneth Skovhede 3b4cd3c9c2 Experiment to set the SQLite temp folder, both through the environment variable and the deprecated pragma statement 2017-01-15 23:09:47 +01:00
Kenneth Skovhede be46960a6b Added debugging code that dumps the temporary tables as permanent tables if the error from #1699, #2048, #2140, or #2178 2017-01-15 23:08:21 +01:00
Kenneth Skovhede 97ba7ef9a5 Fixed issue with restoring files to their original location.
This fixes #2246
2017-01-14 12:46:59 +01:00
Kenneth Skovhede f3570507e3 Merge branch 'master' into feature/improved_consistency_check 2017-01-12 09:31:39 +01:00
Kenneth Skovhede f5a1bcd32c Reverted the SQL query to use the Timestamp sorting instead of explicit fileset.
This fixes #2244
2017-01-11 23:48:41 +01:00
Kenneth Skovhede d3a3d8c85f Fixed a mistake in the debugging code for issue 2140 2017-01-11 13:51:56 +01:00
Kenneth Skovhede a029890409 Implemented better default error messsages 2017-01-09 11:35:38 +01:00
Kenneth Skovhede 9a849a2b58 Improved support for cross-os restores.
This fixes #1302
This fixes #1983
2017-01-06 23:01:54 +01:00
Kenneth Skovhede 8571475938 Merge branch 'feature/debug_listing_for_1400' 2017-01-06 10:03:03 +01:00
Kenneth Skovhede 684bd867ed Merge branch 'feature/debug_listing_for_2140' 2017-01-05 22:16:32 +01:00
Kenneth Skovhede 1b4cb3b5df Merge branch 'feature/implement_remote_file_recovery' 2017-01-05 22:16:25 +01:00
Kenneth Skovhede 179290d521 Added more extensive listing to further pinpoint the source of the error in #1400 2017-01-05 22:15:59 +01:00
Kenneth Skovhede fd0d0d5529 Added tracing output to track down issue #1699, #2140 and #2178 2017-01-05 21:41:21 +01:00
Kenneth Skovhede 1108d51d7f Implemented a new new list-broken-files and purge-broken-files command for the commandline to assist with handling remote file loss. 2017-01-05 16:46:01 +01:00
Kenneth Skovhede 76aae5de7b Changed the logic for getting the last-modified timestamp from the database.
Now we only look at the timestamp from the previous fileset, instead of for the last time the file was seen.
This should improve lookup times, and thus the running time for backups with many files.

This change means that the following sequence of operations will react differently:

- backup
- delete file
- backup
- undelete file
- backup

Prior to this commit, the undeleted file would be seen with the original timestamp and thus can avoid being scanned for changes.
After this commit, the file will be treated as a new file, even if it has the previous timestamp and will thus be scanned for changes.

An additional switch has been introduced, --check-filetime-only that improves the lookup further by not looking at the metadata or filesize, and thus makes a much lighter call to the database, where fewer tables need to be touched.
2017-01-05 10:03:32 +01:00
Kenneth Skovhede 3b85a77673 Minor style fixes 2017-01-05 09:57:06 +01:00