From 74313ca88404608767b6202313cb9bee51d5975e Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 8 Jan 2011 21:33:19 +0000 Subject: 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]). --- bin/bbackupquery/BackupQueries.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'bin/bbackupquery/BackupQueries.cpp') 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 &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 &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 &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 */); -- cgit v1.2.3