summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2007-10-08 23:23:59 +0000
committerChris Wilson <chris+github@qwirx.com>2007-10-08 23:23:59 +0000
commitc127d97acf80136c2c4122d7c4bf5e3f28853272 (patch)
treef9f7b2bf8081f4f2bbce4132fcf8b640af9eca78 /bin
parent62a12cbab2e91bf9eadada6df9150772797426bb (diff)
Allow configuration of the time to delete redundant store locations.
Diffstat (limited to 'bin')
-rw-r--r--bin/bbackupd/BackupDaemon.cpp12
-rw-r--r--bin/bbackupd/BackupDaemon.h2
2 files changed, 9 insertions, 5 deletions
diff --git a/bin/bbackupd/BackupDaemon.cpp b/bin/bbackupd/BackupDaemon.cpp
index b96f6225..ba844c87 100644
--- a/bin/bbackupd/BackupDaemon.cpp
+++ b/bin/bbackupd/BackupDaemon.cpp
@@ -876,6 +876,9 @@ void BackupDaemon::Run2()
SecondsToBoxTime(
conf.GetKeyValueInt(
"MaxFileTimeInFuture"));
+ mDeleteRedundantLocationsAfter =
+ conf.GetKeyValueInt(
+ "DeleteRedundantLocationsAfter");
clientContext.SetMaximumDiffingTime(maximumDiffingTime);
clientContext.SetKeepAliveTime(keepAliveTime);
@@ -1659,7 +1662,7 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
for(std::list<std::pair<std::string, Configuration> >::const_iterator i = rLocationsConf.mSubConfigurations.begin();
i != rLocationsConf.mSubConfigurations.end(); ++i)
{
- BOX_TRACE("new location");
+ BOX_TRACE("new location: " << i->first);
// Create a record for it
Location *ploc = new Location;
try
@@ -1821,12 +1824,12 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
}
catch (std::exception &e)
{
- delete ploc;
- ploc = 0;
BOX_ERROR("Failed to configure location '"
<< ploc->mName << "' path '"
<< ploc->mPath << "': " << e.what() <<
": please check for previous errors");
+ delete ploc;
+ ploc = 0;
throw;
}
catch(...)
@@ -1857,8 +1860,7 @@ void BackupDaemon::SetupLocations(BackupClientContext &rClientContext, const Con
mDeleteUnusedRootDirEntriesAfter == 0)
{
mDeleteUnusedRootDirEntriesAfter = now +
- SecondsToBoxTime(
- BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER);
+ SecondsToBoxTime(mDeleteRedundantLocationsAfter);
}
int secs = BoxTimeToSeconds(mDeleteUnusedRootDirEntriesAfter
diff --git a/bin/bbackupd/BackupDaemon.h b/bin/bbackupd/BackupDaemon.h
index ab64bbfa..580cbea6 100644
--- a/bin/bbackupd/BackupDaemon.h
+++ b/bin/bbackupd/BackupDaemon.h
@@ -158,6 +158,8 @@ private:
std::vector<BackupClientInodeToIDMap *> mCurrentIDMaps;
std::vector<BackupClientInodeToIDMap *> mNewIDMaps;
+ int mDeleteRedundantLocationsAfter;
+
// For the command socket
class CommandSocketInfo
{