Removed whitespace

This commit is contained in:
Carl Johnsen
2025-03-24 14:00:39 +01:00
parent e9d32acd1a
commit c19af329f4
2 changed files with 104 additions and 104 deletions
+63 -63
View File
@@ -1,9 +1,9 @@
# This file is the help for the Duplicati Command Line Client. It shows what
# This file is the help for the Duplicati Command Line Client. It shows what
# commands the CLI understands and what the outputs are. Sometimes we used
# placeholders for options. In that case descriptions are taken directly from
# the modules. Sometimes we described options here. The reason for that is,
# that we found the new description much better but did not want to create a
# need for translation as many options are described in the UI as well and
# the modules. Sometimes we described options here. The reason for that is,
# that we found the new description much better but did not want to create a
# need for translation as many options are described in the UI as well and
# they are translated there.
# =============================================================================
> duplicati.commandline.exe
@@ -29,8 +29,8 @@ https://duplicati.com/ Version: %VERSION%
Show the last changes to Duplicati
==================================
Duplicati updates automatically when a newer version is available. The following command will show a list of versions and changes.
Duplicati updates automatically when a newer version is available. The following command will show a list of versions and changes.
"%APP_PATH%" changelog
# =============================================================================
@@ -39,8 +39,8 @@ Show the last changes to Duplicati
Show system information as seen by Duplicati
============================================
Issue the following command to see a variety of system information relevant to Duplicati.
Issue the following command to see a variety of system information relevant to Duplicati.
"%APP_PATH%" system-info
# =============================================================================
@@ -49,30 +49,30 @@ Show system information as seen by Duplicati
Make an encrypted backup
========================
The following command will make an encrypted backup and store it on an FTP server. As no passphrase is specified, the user is prompted for a password. The upload speed is throttled to 500kB/s. Backups older than one month are considered old. Old backups are deleted automatically. The maximum file size is limited to 50MB (default).
The following command will make an encrypted backup and store it on an FTP server. As no passphrase is specified, the user is prompted for a password. The upload speed is throttled to 500kB/s. Backups older than one month are considered old. Old backups are deleted automatically. The maximum file size is limited to 50MB (default).
"%APP_PATH%" backup ftp://me:example.com@ftp.example.com/target "%EXAMPLE_SOURCE_PATH%" --throttle=500kB
Search for files in a backup
============================
The backup can be searched for specific files. The following command returns all files "%EXAMPLE_SOURCE_FILE%" of the last backup. File names can also contain the wildcards * and ?.
The backup can be searched for specific files. The following command returns all files "%EXAMPLE_SOURCE_FILE%" of the last backup. File names can also contain the wildcards * and ?.
"%APP_PATH%" find ftp://me:example.com@ftp.example.com/target "%EXAMPLE_SOURCE_FILE%"
Restore a specific file
=======================
The following command will restore "%EXAMPLE_SOURCE_FILE%" from the backup in the latest version to its original destination and overwrite an existing file.
"%APP_PATH%" restore ftp://me:example.com@ftp.example.com/target "%EXAMPLE_SOURCE_FILE%" --overwrite
# =============================================================================
> duplicati.commandline.exe help backup
Usage: %CLI_EXE% backup <storage-URL> "<source-path>" [<options>]
Makes a backup of <source-path> and stores it in <storage-URL>. The format for <storage-URL> is
protocol://username:password@hostname:port/path?backend_option1=value1&backend_option2=value2.
Makes a backup of <source-path> and stores it in <storage-URL>. The format for <storage-URL> is
protocol://username:password@hostname:port/path?backend_option1=value1&backend_option2=value2.
Multiple source paths can be specified if they are separated by a space.
%IF_WINDOWS%
On Windows clients, there are two special ways to specify the drive for files to back up. These two methods may help to back up sources on removable drives, whose drive letters may not be reliable.
@@ -107,9 +107,9 @@ Usage: %CLI_EXE% find <storage-URL> ["<filename>"] [<options>]
--version=<int>
Shows what the files looked like in a specific backup. If no version is specified the latest backup (version=0) will be used. If nothing is found, older backups will be searched automatically.
--include=<string>
Reduces the list of files in a backup to those that match the provided string. This is applied before the search is executed.
Reduces the list of files in a backup to those that match the provided string. This is applied before the search is executed.
--exclude=<string>
Removes matching files from the list of files in a backup. This is applied before the search is executed.
Removes matching files from the list of files in a backup. This is applied before the search is executed.
--all-versions=<boolean>
Searches in all backup sets, instead of just searching the latest
@@ -151,14 +151,14 @@ Usage: %CLI_EXE% restore <storage-URL> ["<filename>"] [<options>]
Restore files from a specific backup.
# =============================================================================
> duplicati.commandline.exe help delete
Usage: %CLI_EXE% delete <storage-URL> [<options>]
Marks old data deleted and removes outdated dlist files. A backup is deleted when it is older than <keep-time> or when there are more newer versions than <keep-versions>. Data is considered old, when it is not required from any existing backup anymore.
--dry-run
Performs the operation, but does not write changes to the local database or the remote storage
--keep-time=<time>
@@ -169,26 +169,26 @@ Usage: %CLI_EXE% delete <storage-URL> [<options>]
Deletes all files that belong to the specified version(s).
--allow-full-removal
Disables the protection against removing the final fileset
# =============================================================================
> duplicati.commandline.exe help compact
Usage: %CLI_EXE% compact <storage-URL> [<options>]
Old data is not deleted immediately as in most cases only small parts of a dblock file are old data. When the amount of old data in a dblock file grows it might be worth to replace it. This is especially the case when the number of dblock files and thus the required storage space can be reduced. When backups are frequently made and only few files have changed, the uploaded dblock files are small. At some point it might make sense to replace a large number of small files with one large file. This is what compacting does.
--small-file-max-count=<int>
The maximum allowed number of small files.
--small-file-size=<int>
Files smaller than this size are considered to be small and will be compacted with other small files as soon as there are <small-file-max-count> of them. --small-file-size=20 means 20% of <dblock-size>.
--threshold=<percent_value>
Files smaller than this size are considered to be small and will be compacted with other small files as soon as there are <small-file-max-count> of them. --small-file-size=20 means 20% of <dblock-size>.
--threshold=<percent_value>
The amount of old data that a dblock file can contain before it is considered to be replaced.
# =============================================================================
> duplicati.commandline.exe help compare
@@ -219,7 +219,7 @@ Usage: %CLI_EXE% create-report <storage-URL> <output-file> [<options>]
> duplicati.commandline.exe help repair
Usage: %CLI_EXE% repair <storage-URL> [<options>]
Tries to repair the backup. If no local db is found or the db is empty, the db is re-created with data from the storage. If the db is in place but the remote storage is corrupt, the remote storage gets repaired with local data (if available).
@@ -228,7 +228,7 @@ Usage: %CLI_EXE% repair <storage-URL> [<options>]
> duplicati.commandline.exe help purge
Usage: %CLI_EXE% purge <storage-URL> <filenames> [<options>]
Purges (removes) files from remote backup data. This command can either take a list of filenames or use the filters to choose which files to purge. The purge process creates new filesets on the remote destination with the purged files removed, and will start the compacting process after a purge. By default, the matching files are purged in all versions, but this can be limited by choosing one or more versions. To test what will happen, use the --dry-run flag.
--dry-run
@@ -250,7 +250,7 @@ Usage: %CLI_EXE% purge <storage-URL> <filenames> [<options>]
> duplicati.commandline.exe help purge-broken-files
Usage: %CLI_EXE% list-broken-files <storage-URL> [<options>]
Checks the database for missing data that cause files not not be restoreable. Files can become unrestoreable if remote data files are defect or missing. Use the list-broken-files command to see what the purge-broken-files command will remove.
Usage: %CLI_EXE% purge-broken-files <storage-URL> [<options>]
@@ -259,39 +259,39 @@ Usage: %CLI_EXE% purge-broken-files <storage-URL> [<options>]
--dry-run
Performs the operation, but does not write changes to the local database or the remote storage
# =============================================================================
> duplicati.commandline.exe help test
> duplicati.commandline.exe help verify
Usage: %CLI_EXE% test <storage-URL> <samples> [<options>]
Verifies integrity of a backup. A random sample of dlist, dindex, dblock files is downloaded, decrypted and the content is checked against recorded size values and data hashes. <samples> specifies the number of samples to be tested. If "all” is specified, all files in the backup will be tested. This is a rolling check, i.e. when executed another time different samples are verified than in the first run. A sample consists of 1 dlist, 1 dindex, 1 dblock.
--time=<time>
Checks samples from a specific time.
--version=<int>
Checks samples from specific versions. Delimiters are , -
--full-remote-verification
Checks the internal structure of each file instead of just verifying the file hash
# =============================================================================
> duplicati.commandline.exe help test-filters
> duplicati.commandline.exe help test-filter
Usage: %CLI_EXE% test-filters <source-path> [<options>]
Scans the source files and tests against the filters specified, the console output shows which files and folders are examined and the result.
# =============================================================================
> duplicati.commandline.exe help affected
Usage: %CLI_EXE% affected <storage-URL> <remote-filename> [<remote-filenames>] [<options>]
Returns a report explaining what backup sets and files are affected by a remote file. You can use this option to see what source files are affected if one or more remote files are damaged or deleted. Notes that this command requires a local database to be present, if the database is not found automatically, you can set --dbpath to point to the database to use.
# =============================================================================
@@ -299,8 +299,8 @@ Usage: %CLI_EXE% affected <storage-URL> <remote-filename> [<remote-filenames>] [
Usage: %CLI_EXE% vacuum <storage-URL> [<options>]
Rebuilds the local database, repacking it into a minimal amount of disk space.
Rebuilds the local database, repacking it into a minimal amount of disk space.
# =============================================================================
> duplicati.commandline.exe help debug
> duplicati.commandline.exe help logging
@@ -313,12 +313,12 @@ Duplicati provides information for debugging and logging purposes. By default, a
If something needs to be retried (e.g. upload failed) this will cause an entry in the log file.
--log-file = <path>
The path to the log file e.g. "D:\duplicati\log.txt".
--log-file-log-level = Profiling | Verbose | Information | Warning | Error
--log-file-log-level = Profiling | Verbose | Information | Warning | Error
Specifies the log level to use for the log file.
--console-log-level = Profiling | Verbose | Information | Warning | Error
--console-log-level = Profiling | Verbose | Information | Warning | Error
Specifies the log level to use for the console log.
# =============================================================================
> duplicati.commandline.exe help encryption
> duplicati.commandline.exe help compression
@@ -375,7 +375,7 @@ Options:
Duplicati can use FTP servers to store backups. The following target URL formats can be used:
ftp://hostname/folder
Options:
%MODULEOPTIONS%
@@ -385,7 +385,7 @@ Options:
Duplicati can use SSH servers to store backups. The following target URL formats can be used:
ssh://hostname/folder
Options:
%MODULEOPTIONS%
@@ -395,7 +395,7 @@ Options:
Duplicati can use WebDAV servers to store backups. The following target URL formats can be used:
webdav://hostname/folder"
Options:
%MODULEOPTIONS%
@@ -436,11 +436,11 @@ Options:
Duplicati supports absolute and relative dates and times:
now --> The current time
1234567890 --> A timestamp, seconds since 1970.
"2009-03-26T08:30:00+01:00" --> An absolute date and time. You can also use the local date and time format of your system like e.g. "01-14-2000" or "01 jan. 2004".
Y, M, D, W, h, m, s --> Relative date and time: year, month, day, week, hour, minute, second. Example: 2M10D5h is now + 2 months + 10 days + 5 hours.
# =============================================================================
@@ -452,7 +452,7 @@ Whenever a size is required, you can use any of the following suffixes:
kB - Kilobytes
MB - Megabytes
GB - Gigabytes
For speed limits, use the same format. If you enter 1MB this will be 1MB/sec.
# =============================================================================
@@ -468,7 +468,7 @@ For entering decimal values you must use the English notation, with a period as
> duplicati.commandline.exe help filter
> duplicati.commandline.exe help filters
Duplicati can apply globbing and regex filter rules to backup and restore specific files only. Globbing filters can be used in file names. To specify a regex filter put the filter in [brackets].
Duplicati can apply globbing and regex filter rules to backup and restore specific files only. Globbing filters can be used in file names. To specify a regex filter put the filter in [brackets].
Globbing: *.txt
Regex: [.*test\.txt]
@@ -498,12 +498,12 @@ Duplicati has several built-in groups of filters, which include commonly exclude
> duplicati.commandline.exe help send-mail
Duplicati can send email notifications after each operation. Use the send-mail command to test this:
"%APP_PATH%" send-mail --send-mail-to=<email-address>
--send-mail-to=<email-address>
Send an email to <email-address> after a backup. Valid formats are "Name <test@example.com>, Other <test2@example.com>, test3@example.com". Multiple addresses must be separated with a comma.
Send an email to <email-address> after a backup. Valid formats are "Name <test@example.com>, Other <test2@example.com>, test3@example.com". Multiple addresses must be separated with a comma.
--send-mail-from=<email-address>
This is the sender address of the email that is sent.
--send-mail-subject=<subject>
@@ -520,12 +520,12 @@ Duplicati can send email notifications after each operation. Use the send-mail c
When email messages are sent: "Success", "Warning", "Error", "Fatal", "All" are possible.
--send-mail-any-operation=true
Also send emails after other operations like restore etc.
Allowed placeholders are:
%PARSEDRESULT%
The parsed result op the operation: Success, Warning, Error
%RESULT%
When used in the body, this is the result/log of the backup,
When used in the body, this is the result/log of the backup,
When used in the subject line, this is the same as %PARSEDRESULT%
%OPERATIONNAME%
The name of the operation, usually "backup", but could also be "restore" etc.
@@ -543,7 +543,7 @@ Duplicati can send email notifications after each operation. Use the send-mail c
The name of the machine, can be overridden with --machine-name
# =============================================================================
> duplicati.commandline.exe help advanced
> duplicati.commandline.exe help option
@@ -593,7 +593,7 @@ To support more robust parsing, it is also possible to change the pattern from t
This would extract keys inside that pattern, such as extracting "key name" from "!secret{key name}".
For providers that return a set of secrets, the key lookup is default case insensitive.
For providers that return a set of secrets, the key lookup is default case insensitive.
For providers that require a request per secret, the lookup is case-sensitive.
The following secret providers are supported:
@@ -93,14 +93,14 @@ namespace Duplicati.Library.Main.Database
cmd.ExecuteNonQuery(FormatInvariant($@"CREATE TEMPORARY TABLE ""{m_fileprogtable}"" (
""FileId"" INTEGER PRIMARY KEY,
""TotalBlocks"" INTEGER NOT NULL, ""TotalSize"" INTEGER NOT NULL,
""BlocksRestored"" INTEGER NOT NULL, ""SizeRestored"" INTEGER NOT NULL
""BlocksRestored"" INTEGER NOT NULL, ""SizeRestored"" INTEGER NOT NULL
)"));
cmd.ExecuteNonQuery(FormatInvariant($@"DROP TABLE IF EXISTS ""{m_totalprogtable}"" "));
cmd.ExecuteNonQuery(FormatInvariant($@"CREATE TEMPORARY TABLE ""{m_totalprogtable}"" (
""TotalFiles"" INTEGER NOT NULL, ""TotalBlocks"" INTEGER NOT NULL, ""TotalSize"" INTEGER NOT NULL,
""FilesFullyRestored"" INTEGER NOT NULL, ""FilesPartiallyRestored"" INTEGER NOT NULL,
""BlocksRestored"" INTEGER NOT NULL, ""SizeRestored"" INTEGER NOT NULL
""BlocksRestored"" INTEGER NOT NULL, ""SizeRestored"" INTEGER NOT NULL
)"));
if (createFilesNewlyDoneTracker)
@@ -121,10 +121,10 @@ namespace Duplicati.Library.Main.Database
// We use a LEFT JOIN to allow for empty files (no data Blocks)
sql = FormatInvariant($@" INSERT INTO ""{m_fileprogtable}"" (""FileId"", ""TotalBlocks"", ""TotalSize"", ""BlocksRestored"", ""SizeRestored"")
SELECT ""F"".""ID"", IFNULL(COUNT(""B"".""ID""), 0), IFNULL(SUM(""B"".""Size""), 0)
, IFNULL(COUNT(CASE ""B"".""Restored"" WHEN 1 THEN ""B"".""ID"" ELSE NULL END), 0)
, IFNULL(SUM(CASE ""B"".""Restored"" WHEN 1 THEN ""B"".""Size"" ELSE 0 END), 0)
, IFNULL(COUNT(CASE ""B"".""Restored"" WHEN 1 THEN ""B"".""ID"" ELSE NULL END), 0)
, IFNULL(SUM(CASE ""B"".""Restored"" WHEN 1 THEN ""B"".""Size"" ELSE 0 END), 0)
FROM ""{m_tempfiletable}"" ""F"" LEFT JOIN ""{m_tempblocktable}"" ""B""
ON ""B"".""FileID"" = ""F"".""ID""
ON ""B"".""FileID"" = ""F"".""ID""
WHERE ""B"".""Metadata"" IS NOT 1
GROUP BY ""F"".""ID"" ");
@@ -132,13 +132,13 @@ SELECT ""F"".""ID"", IFNULL(COUNT(""B"".""ID""), 0), IFNULL(SUM(""B"".""Size""
cmd.ExecuteNonQuery(sql);
sql = FormatInvariant($@"INSERT INTO ""{m_totalprogtable}"" (
""TotalFiles"", ""TotalBlocks"", ""TotalSize""
""TotalFiles"", ""TotalBlocks"", ""TotalSize""
, ""FilesFullyRestored"", ""FilesPartiallyRestored"", ""BlocksRestored"", ""SizeRestored""
)
SELECT IFNULL(COUNT(""P"".""FileId""), 0), IFNULL(SUM(""P"".""TotalBlocks""), 0), IFNULL(SUM(""P"".""TotalSize""), 0)
, IFNULL(COUNT(CASE WHEN ""P"".""BlocksRestored"" = ""P"".""TotalBlocks"" THEN 1 ELSE NULL END), 0)
, IFNULL(COUNT(CASE WHEN ""P"".""BlocksRestored"" BETWEEN 1 AND ""P"".""TotalBlocks"" - 1 THEN 1 ELSE NULL END), 0)
, IFNULL(SUM(""P"".""BlocksRestored""), 0), IFNULL(SUM(""P"".""SizeRestored""), 0)
)
SELECT IFNULL(COUNT(""P"".""FileId""), 0), IFNULL(SUM(""P"".""TotalBlocks""), 0), IFNULL(SUM(""P"".""TotalSize""), 0)
, IFNULL(COUNT(CASE WHEN ""P"".""BlocksRestored"" = ""P"".""TotalBlocks"" THEN 1 ELSE NULL END), 0)
, IFNULL(COUNT(CASE WHEN ""P"".""BlocksRestored"" BETWEEN 1 AND ""P"".""TotalBlocks"" - 1 THEN 1 ELSE NULL END), 0)
, IFNULL(SUM(""P"".""BlocksRestored""), 0), IFNULL(SUM(""P"".""SizeRestored""), 0)
FROM ""{m_fileprogtable}"" ""P"" ");
// Will result in a single line (no support to also track metadata)
@@ -152,25 +152,25 @@ SELECT ""F"".""ID"", IFNULL(COUNT(""B"".""ID""), 0), IFNULL(SUM(""B"".""Size""
// A trigger to update the file-stat entry each time a block changes restoration state.
sql = FormatInvariant($@"CREATE TEMPORARY TRIGGER ""TrackRestoredBlocks_{m_tempblocktable}"" AFTER UPDATE OF ""Restored"" ON ""{m_tempblocktable}""
WHEN OLD.""Restored"" != NEW.""Restored"" AND NEW.""Metadata"" = 0
BEGIN UPDATE ""{m_fileprogtable}""
SET ""BlocksRestored"" = ""{m_fileprogtable}"".""BlocksRestored"" + (NEW.""Restored"" - OLD.""Restored"")
, ""SizeRestored"" = ""{m_fileprogtable}"".""SizeRestored"" + ((NEW.""Restored"" - OLD.""Restored"") * NEW.Size)
WHERE ""{m_fileprogtable}"".""FileId"" = NEW.""FileID""
WHEN OLD.""Restored"" != NEW.""Restored"" AND NEW.""Metadata"" = 0
BEGIN UPDATE ""{m_fileprogtable}""
SET ""BlocksRestored"" = ""{m_fileprogtable}"".""BlocksRestored"" + (NEW.""Restored"" - OLD.""Restored"")
, ""SizeRestored"" = ""{m_fileprogtable}"".""SizeRestored"" + ((NEW.""Restored"" - OLD.""Restored"") * NEW.Size)
WHERE ""{m_fileprogtable}"".""FileId"" = NEW.""FileID""
; END ");
cmd.ExecuteNonQuery(sql);
// A trigger to update total stats each time a file stat changed (nested triggering by file-stats)
sql = FormatInvariant($@"CREATE TEMPORARY TRIGGER ""UpdateTotalStats_{m_fileprogtable}"" AFTER UPDATE ON ""{m_fileprogtable}""
BEGIN UPDATE ""{m_totalprogtable}""
SET ""FilesFullyRestored"" = ""{m_totalprogtable}"".""FilesFullyRestored""
+ (CASE WHEN NEW.""BlocksRestored"" = NEW.""TotalBlocks"" THEN 1 ELSE 0 END)
- (CASE WHEN OLD.""BlocksRestored"" = OLD.""TotalBlocks"" THEN 1 ELSE 0 END)
, ""FilesPartiallyRestored"" = ""{m_totalprogtable}"".""FilesPartiallyRestored""
+ (CASE WHEN NEW.""BlocksRestored"" BETWEEN 1 AND NEW.""TotalBlocks"" - 1 THEN 1 ELSE 0 END)
- (CASE WHEN OLD.""BlocksRestored"" BETWEEN 1 AND OLD.""TotalBlocks"" - 1 THEN 1 ELSE 0 END)
BEGIN UPDATE ""{m_totalprogtable}""
SET ""FilesFullyRestored"" = ""{m_totalprogtable}"".""FilesFullyRestored""
+ (CASE WHEN NEW.""BlocksRestored"" = NEW.""TotalBlocks"" THEN 1 ELSE 0 END)
- (CASE WHEN OLD.""BlocksRestored"" = OLD.""TotalBlocks"" THEN 1 ELSE 0 END)
, ""FilesPartiallyRestored"" = ""{m_totalprogtable}"".""FilesPartiallyRestored""
+ (CASE WHEN NEW.""BlocksRestored"" BETWEEN 1 AND NEW.""TotalBlocks"" - 1 THEN 1 ELSE 0 END)
- (CASE WHEN OLD.""BlocksRestored"" BETWEEN 1 AND OLD.""TotalBlocks"" - 1 THEN 1 ELSE 0 END)
, ""BlocksRestored"" = ""{m_totalprogtable}"".""BlocksRestored"" + NEW.""BlocksRestored"" - OLD.""BlocksRestored""
, ""SizeRestored"" = ""{m_totalprogtable}"".""SizeRestored"" + NEW.""SizeRestored"" - OLD.""SizeRestored""
, ""SizeRestored"" = ""{m_totalprogtable}"".""SizeRestored"" + NEW.""SizeRestored"" - OLD.""SizeRestored""
; END");
cmd.ExecuteNonQuery(sql);
@@ -179,9 +179,9 @@ BEGIN UPDATE ""{m_totalprogtable}""
{
// A trigger checking if a file is done (all blocks restored in file-stat) (nested triggering by file-stats)
sql = FormatInvariant($@"CREATE TEMPORARY TRIGGER ""UpdateFilesNewlyDone_{m_fileprogtable}"" AFTER UPDATE OF ""BlocksRestored"", ""TotalBlocks"" ON ""{m_fileprogtable}""
WHEN NEW.""BlocksRestored"" = NEW.""TotalBlocks""
BEGIN
INSERT OR IGNORE INTO ""{m_filesnewlydonetable}"" (""ID"") VALUES (NEW.""FileId"");
WHEN NEW.""BlocksRestored"" = NEW.""TotalBlocks""
BEGIN
INSERT OR IGNORE INTO ""{m_filesnewlydonetable}"" (""ID"") VALUES (NEW.""FileId"");
END ");
cmd.ExecuteNonQuery(sql);
}
@@ -735,12 +735,12 @@ END ");
// One could also use like the average block number in a volume, that needs to be measured.
cmd.CommandText = FormatInvariant($@"SELECT ""RV"".""Name"", ""RV"".""Hash"", ""RV"".""Size"", ""BB"".""MaxIndex""
FROM ""RemoteVolume"" ""RV"" INNER JOIN
(SELECT ""TB"".""VolumeID"", MAX(""TB"".""Index"") as ""MaxIndex""
FROM ""{m_tempblocktable}"" ""TB""
WHERE ""TB"".""Restored"" = 0
GROUP BY ""TB"".""VolumeID""
) as ""BB"" ON ""RV"".""ID"" = ""BB"".""VolumeID""
FROM ""RemoteVolume"" ""RV"" INNER JOIN
(SELECT ""TB"".""VolumeID"", MAX(""TB"".""Index"") as ""MaxIndex""
FROM ""{m_tempblocktable}"" ""TB""
WHERE ""TB"".""Restored"" = 0
GROUP BY ""TB"".""VolumeID""
) as ""BB"" ON ""RV"".""ID"" = ""BB"".""VolumeID""
ORDER BY ""BB"".""MaxIndex"" ");
using (var rd = cmd.ExecuteReader())
@@ -848,10 +848,10 @@ ORDER BY ""BB"".""MaxIndex"" ");
using (var cmd = m_connection.CreateCommand())
{
// The IN-clause with subquery enables SQLite to use indexes better. Three way join (A,B,C) is slow here!
cmd.CommandText = FormatInvariant($@" SELECT DISTINCT ""A"".""TargetPath"", ""BB"".""FileID"", (""BB"".""Index"" * {m_blocksize}), ""BB"".""Size"", ""BB"".""Hash""
FROM ""{m_filetablename}"" ""A"", ""{m_blocktablename}"" ""BB""
cmd.CommandText = FormatInvariant($@" SELECT DISTINCT ""A"".""TargetPath"", ""BB"".""FileID"", (""BB"".""Index"" * {m_blocksize}), ""BB"".""Size"", ""BB"".""Hash""
FROM ""{m_filetablename}"" ""A"", ""{m_blocktablename}"" ""BB""
WHERE ""A"".""ID"" = ""BB"".""FileID"" AND ""BB"".""Restored"" = 0 AND ""BB"".""Metadata"" = {"0"}
AND ""BB"".""ID"" IN (SELECT ""B"".""ID"" FROM ""{m_blocktablename}"" ""B"", ""{m_tmptable}"" ""C"" WHERE ""B"".""Hash"" = ""C"".""Hash"" AND ""B"".""Size"" = ""C"".""Size"")
AND ""BB"".""ID"" IN (SELECT ""B"".""ID"" FROM ""{m_blocktablename}"" ""B"", ""{m_tmptable}"" ""C"" WHERE ""B"".""Hash"" = ""C"".""Hash"" AND ""B"".""Size"" = ""C"".""Size"")
ORDER BY ""A"".""TargetPath"", ""BB"".""Index""");
using (var rd = cmd.ExecuteReader())
{
@@ -881,10 +881,10 @@ ORDER BY ""A"".""TargetPath"", ""BB"".""Index""");
using (var cmd = m_connection.CreateCommand())
{
// The IN-clause with subquery enables SQLite to use indexes better. Three way join (A,B,C) is slow here!
cmd.CommandText = FormatInvariant($@" SELECT DISTINCT ""A"".""TargetPath"", ""BB"".""FileID"", (""BB"".""Index"" * {m_blocksize}), ""BB"".""Size"", ""BB"".""Hash""
FROM ""{m_filetablename}"" ""A"", ""{m_blocktablename}"" ""BB""
cmd.CommandText = FormatInvariant($@" SELECT DISTINCT ""A"".""TargetPath"", ""BB"".""FileID"", (""BB"".""Index"" * {m_blocksize}), ""BB"".""Size"", ""BB"".""Hash""
FROM ""{m_filetablename}"" ""A"", ""{m_blocktablename}"" ""BB""
WHERE ""A"".""ID"" = ""BB"".""FileID"" AND ""BB"".""Restored"" = 0 AND ""BB"".""Metadata"" = {"1"}
AND ""BB"".""ID"" IN (SELECT ""B"".""ID"" FROM ""{m_blocktablename}"" ""B"", ""{m_tmptable}"" ""C"" WHERE ""B"".""Hash"" = ""C"".""Hash"" AND ""B"".""Size"" = ""C"".""Size"")
AND ""BB"".""ID"" IN (SELECT ""B"".""ID"" FROM ""{m_blocktablename}"" ""B"", ""{m_tmptable}"" ""C"" WHERE ""B"".""Hash"" = ""C"".""Hash"" AND ""B"".""Size"" = ""C"".""Size"")
ORDER BY ""A"".""TargetPath"", ""BB"".""Index""");
using (var rd = cmd.ExecuteReader())
{
@@ -1409,7 +1409,7 @@ WHERE ""FileID"" = @TargetFileId AND ""Index"" = @Index AND ""Hash"" = @Hash AND
cmd.ExecuteNonQuery(FormatInvariant($@"UPDATE ""{m_tempfiletable}"" SET LatestBlocksetId = (SELECT BlocksetId FROM ""{m_latestblocktable}"" WHERE Path = ""{m_tempfiletable}"".Path)"));
}
var sources = FormatInvariant($@"
var sources = FormatInvariant($@"
SELECT DISTINCT
""{m_tempfiletable}"".""TargetPath"",
""{m_tempfiletable}"".""Path"",
@@ -1426,7 +1426,7 @@ WHERE
""BlocksetEntry"".""BlocksetID"" = ""{m_tempfiletable}"".""LatestBlocksetID"" AND
""BlocksetEntry"".""BlockID"" = ""{m_tempblocktable}"".""BlockID"" AND
""BlocksetEntry"".""Index"" = ""{m_tempblocktable}"".""Index"" AND
{whereclause}
{whereclause}
ORDER BY ""{m_tempfiletable}"".""ID"", ""{m_tempblocktable}"".""Index"" ");
using (var cmd = m_connection.CreateCommand())