summaryrefslogtreecommitdiff
path: root/lib/backupclient
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-28 01:13:54 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-28 01:13:54 +0200
commit7b4540ae3c9ac331eed17fdf15a33f64b103cb4d (patch)
treeca47acead4e3676acd942de5f443d7bdc5fdd90c /lib/backupclient
parent8a937bd354001a190dbe66538aacb353e7c99341 (diff)
Import upstream version 0.11.1~r2837
Diffstat (limited to 'lib/backupclient')
-rw-r--r--lib/backupclient/BackupClientFileAttributes.cpp7
-rw-r--r--lib/backupclient/BackupClientRestore.cpp29
-rw-r--r--lib/backupclient/BackupClientRestore.h1
-rw-r--r--lib/backupclient/BackupDaemonConfigVerify.cpp2
-rw-r--r--lib/backupclient/BackupStoreFile.cpp10
5 files changed, 37 insertions, 12 deletions
diff --git a/lib/backupclient/BackupClientFileAttributes.cpp b/lib/backupclient/BackupClientFileAttributes.cpp
index af156a1d..b25ed9c7 100644
--- a/lib/backupclient/BackupClientFileAttributes.cpp
+++ b/lib/backupclient/BackupClientFileAttributes.cpp
@@ -843,9 +843,10 @@ void BackupClientFileAttributes::WriteAttributes(const char *Filename,
// Try to apply
if(::utimes(Filename, times) != 0)
{
- BOX_LOG_SYS_ERROR("Failed to change times of "
- "file '" << Filename << "'");
- THROW_EXCEPTION(CommonException, OSFileError)
+ BOX_LOG_SYS_WARNING("Failed to change times of "
+ "file '" << Filename << "' to ctime=" <<
+ BOX_FORMAT_TIMESPEC(times[0]) << ", mtime=" <<
+ BOX_FORMAT_TIMESPEC(times[1]));
}
}
diff --git a/lib/backupclient/BackupClientRestore.cpp b/lib/backupclient/BackupClientRestore.cpp
index b1c5cd0f..fa61bb59 100644
--- a/lib/backupclient/BackupClientRestore.cpp
+++ b/lib/backupclient/BackupClientRestore.cpp
@@ -211,7 +211,8 @@ typedef struct
//
// --------------------------------------------------------------------------
static int BackupClientRestoreDir(BackupProtocolClient &rConnection,
- int64_t DirectoryID, std::string &rLocalDirectoryName,
+ int64_t DirectoryID, const std::string &rRemoteDirectoryName,
+ const std::string &rLocalDirectoryName,
RestoreParams &Params, RestoreResumeInfo &rLevel)
{
// If we're resuming... check that we haven't got a next level to
@@ -223,7 +224,9 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection,
DIRECTORY_SEPARATOR_ASCHAR +
rLevel.mNextLevelLocalName);
BackupClientRestoreDir(rConnection, rLevel.mNextLevelID,
- localDirname, Params, *rLevel.mpNextLevel);
+ rRemoteDirectoryName + '/' +
+ rLevel.mNextLevelLocalName, localDirname,
+ Params, *rLevel.mpNextLevel);
// Add it to the list of done itmes
rLevel.mRestoredObjects.insert(rLevel.mNextLevelID);
@@ -526,6 +529,11 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection,
}
}
+ BOX_TRACE("Restoring file: " <<
+ rRemoteDirectoryName + '/' +
+ nm.GetClearFilename() << " (" <<
+ en->GetSizeInBlocks() << " blocks)");
+
// Request it from the store
rConnection.QueryGetFile(DirectoryID,
en->GetObjectID());
@@ -739,9 +747,16 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection,
nm.GetClearFilename()));
// Recurse
+
+ BOX_TRACE("Entering directory: " <<
+ rRemoteDirectoryName + '/' +
+ nm.GetClearFilename());
+
int result = BackupClientRestoreDir(
rConnection, en->GetObjectID(),
- localDirname, Params, rnextLevel);
+ rRemoteDirectoryName + '/' +
+ nm.GetClearFilename(), localDirname,
+ Params, rnextLevel);
if (result != Restore_Complete)
{
@@ -824,8 +839,8 @@ static int BackupClientRestoreDir(BackupProtocolClient &rConnection,
//
// --------------------------------------------------------------------------
int BackupClientRestore(BackupProtocolClient &rConnection,
- int64_t DirectoryID, const char *LocalDirectoryName,
- bool PrintDots, bool RestoreDeleted,
+ int64_t DirectoryID, const char *RemoteDirectoryName,
+ const char *LocalDirectoryName, bool PrintDots, bool RestoreDeleted,
bool UndeleteAfterRestoreDeleted, bool Resume,
bool ContinueAfterErrors)
{
@@ -872,9 +887,9 @@ int BackupClientRestore(BackupProtocolClient &rConnection,
}
// Restore the directory
- std::string localName(LocalDirectoryName);
int result = BackupClientRestoreDir(rConnection, DirectoryID,
- localName, params, params.mResumeInfo);
+ RemoteDirectoryName, LocalDirectoryName, params,
+ params.mResumeInfo);
if (result != Restore_Complete)
{
return result;
diff --git a/lib/backupclient/BackupClientRestore.h b/lib/backupclient/BackupClientRestore.h
index 7e492238..311a15bd 100644
--- a/lib/backupclient/BackupClientRestore.h
+++ b/lib/backupclient/BackupClientRestore.h
@@ -24,6 +24,7 @@ enum
int BackupClientRestore(BackupProtocolClient &rConnection,
int64_t DirectoryID,
+ const char *RemoteDirectoryName,
const char *LocalDirectoryName,
bool PrintDots = false,
bool RestoreDeleted = false,
diff --git a/lib/backupclient/BackupDaemonConfigVerify.cpp b/lib/backupclient/BackupDaemonConfigVerify.cpp
index e70ba865..dfef5b03 100644
--- a/lib/backupclient/BackupDaemonConfigVerify.cpp
+++ b/lib/backupclient/BackupDaemonConfigVerify.cpp
@@ -65,7 +65,7 @@ static const ConfigurationVerify verifyserver[] =
static const ConfigurationVerifyKey verifyrootkeys[] =
{
ConfigurationVerifyKey("AccountNumber",
- ConfigTest_Exists | ConfigTest_IsInt),
+ ConfigTest_Exists | ConfigTest_IsUint32),
ConfigurationVerifyKey("UpdateStoreInterval",
ConfigTest_Exists | ConfigTest_IsInt),
ConfigurationVerifyKey("MinimumFileAge",
diff --git a/lib/backupclient/BackupStoreFile.cpp b/lib/backupclient/BackupStoreFile.cpp
index 27e12bc8..17e145a3 100644
--- a/lib/backupclient/BackupStoreFile.cpp
+++ b/lib/backupclient/BackupStoreFile.cpp
@@ -311,7 +311,15 @@ void BackupStoreFile::DecodeFile(IOStream &rEncodedFile, const char *DecodedFile
// ASSERT(drained == 0);
// Write the attributes
- stream->GetAttributes().WriteAttributes(DecodedFilename);
+ try
+ {
+ stream->GetAttributes().WriteAttributes(DecodedFilename);
+ }
+ catch (std::exception& e)
+ {
+ BOX_WARNING("Failed to restore attributes on " <<
+ DecodedFilename << ": " << e.what());
+ }
}
catch(...)
{