diff options
author | Chris Wilson <chris+github@qwirx.com> | 2011-01-08 21:33:19 +0000 |
---|---|---|
committer | Chris Wilson <chris+github@qwirx.com> | 2011-01-08 21:33:19 +0000 |
commit | 74313ca88404608767b6202313cb9bee51d5975e (patch) | |
tree | 4eb130d2b0a06a714229c91568fa2bb4f39d306f /bin/bbackupquery | |
parent | 24d88d1bcbe740c230c6ddace0ef982b579e6af8 (diff) |
Log the path, name and size of files being restored at TRACE level for
users wanting more detailed restore output.
Disable printing dots when logging at TRACE level is enabled.
Warn rather than failing to restore when the file attributes could not
be restored. (merges [2745], [2827]).
Diffstat (limited to 'bin/bbackupquery')
-rw-r--r-- | bin/bbackupquery/BackupQueries.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/bin/bbackupquery/BackupQueries.cpp b/bin/bbackupquery/BackupQueries.cpp index 8bed080f..bed28367 100644 --- a/bin/bbackupquery/BackupQueries.cpp +++ b/bin/bbackupquery/BackupQueries.cpp @@ -2368,6 +2368,8 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b // Restoring deleted things? bool restoreDeleted = opts['d']; + std::string storeDirEncoded; + // Get directory ID int64_t dirID = 0; if(opts['i']) @@ -2379,15 +2381,17 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b BOX_ERROR("Not a valid object ID (specified in hex)"); return; } + std::ostringstream oss; + oss << BOX_FORMAT_OBJECTID(args[0]); + storeDirEncoded = oss.str(); } else { #ifdef WIN32 - std::string storeDirEncoded; if(!ConvertConsoleToUtf8(args[0].c_str(), storeDirEncoded)) return; #else - const std::string& storeDirEncoded(args[0]); + storeDirEncoded = args[0]; #endif // Look up directory ID @@ -2432,9 +2436,14 @@ void BackupQueries::CommandRestore(const std::vector<std::string> &args, const b try { + // At TRACE level, we print a line for each file and + // directory, so we don't need dots. + + bool printDots = ! Logging::IsEnabled(Log::TRACE); + result = BackupClientRestore(mrConnection, dirID, - localName.c_str(), - true /* print progress dots */, restoreDeleted, + storeDirEncoded.c_str(), localName.c_str(), + printDots /* print progress dots */, restoreDeleted, false /* don't undelete after restore! */, opts['r'] /* resume? */, opts['f'] /* force continue after errors */); |