From 7eba897f6da8b1a993f0d40251af1748b5c793ea Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 5 May 2008 14:44:38 +0000 Subject: Add restore -f option to force restore to continue after an error. --- bin/bbackupquery/BackupQueries.cpp | 18 +++++++++++++----- bin/bbackupquery/documentation.txt | 3 ++- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'bin') diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index 61b7e85b..7a7eb5cc 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -217,7 +217,7 @@ void BackupQueries::DoCommand(const char *Command, bool isFromCommandLine) { "getobject", "" }, { "get", "i" }, { "compare", "alcqAEQ" }, - { "restore", "dri" }, + { "restore", "drif" }, { "help", "" }, { "usage", "" }, { "undelete", "" }, @@ -1966,7 +1966,7 @@ void BackupQueries::CommandRestore(const std::vector &args, const b // Check arguments if(args.size() != 2) { - BOX_ERROR("Incorrect usage. restore [-d] [-r] [-i] "); + BOX_ERROR("Incorrect usage. restore [-drif] "); return; } @@ -2029,7 +2029,8 @@ void BackupQueries::CommandRestore(const std::vector &args, const b localName.c_str(), true /* print progress dots */, restoreDeleted, false /* don't undelete after restore! */, - opts['r'] /* resume? */); + opts['r'] /* resume? */, + opts['f'] /* force continue after errors */); } catch(std::exception &e) { @@ -2050,13 +2051,20 @@ void BackupQueries::CommandRestore(const std::vector &args, const b BOX_INFO("Restore complete."); break; + case Restore_CompleteWithErrors: + BOX_WARNING("Restore complete, but some files could not be " + "restored."); + break; + case Restore_ResumePossible: - BOX_ERROR("Resume possible -- repeat command with -r flag to resume"); + BOX_ERROR("Resume possible -- repeat command with -r flag " + "to resume."); SetReturnCode(COMMAND_RETURN_ERROR); break; case Restore_TargetExists: - BOX_ERROR("The target directory exists. You cannot restore over an existing directory."); + BOX_ERROR("The target directory exists. You cannot restore " + "over an existing directory."); SetReturnCode(COMMAND_RETURN_ERROR); break; diff --git a/bin/bbackupquery/documentation.txt b/bin/bbackupquery/documentation.txt index 42217edc..84126bee 100644 --- a/bin/bbackupquery/documentation.txt +++ b/bin/bbackupquery/documentation.txt @@ -116,7 +116,7 @@ compare This can be used for automated tests. < -> restore [-d] [-r] [-i] +> restore [-drif] Restores a directory to the local disc. The local directory specified must not exist (unless a previous restore is being restarted). @@ -126,6 +126,7 @@ compare -d -- restore a deleted directory or deleted files inside -r -- resume an interrupted restoration -i -- directory name is actually an ID + -f -- force restore to continue if errors are encountered If a restore operation is interrupted for any reason, it can be restarted using the -r switch. Restore progress information is saved in a file at -- cgit v1.2.3