Updated the affected command to check if the local database is found, and to return an error if not.
Also updated the help text to indicate that a database is required.
This commit is contained in:
@@ -269,7 +269,7 @@ Usage: test-filters <source-path> [<options>]
|
||||
|
||||
Usage: 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.
|
||||
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.
|
||||
|
||||
# =============================================================================
|
||||
> duplicati.commandline.exe help vacuum
|
||||
|
||||
@@ -18,7 +18,8 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Duplicati.Library.Interface;
|
||||
|
||||
namespace Duplicati.Library.Main.Operation
|
||||
{
|
||||
internal class ListAffected
|
||||
@@ -34,6 +35,9 @@ namespace Duplicati.Library.Main.Operation
|
||||
|
||||
public void Run(List<string> args, Action<Duplicati.Library.Interface.IListAffectedResults> callback = null)
|
||||
{
|
||||
if (!System.IO.File.Exists(m_options.Dbpath))
|
||||
throw new UserInformationException(string.Format("Database file does not exist: {0}", m_options.Dbpath));
|
||||
|
||||
using(var db = new Database.LocalListAffectedDatabase(m_options.Dbpath))
|
||||
{
|
||||
m_result.SetDatabase(db);
|
||||
|
||||
Reference in New Issue
Block a user