Changeset 1863

Show
Ignore:
Timestamp:
09/10/2007 00:23:59 (15 months ago)
Author:
chris
Message:

Allow configuration of the time to delete redundant store locations.

Location:
box/trunk
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • box/trunk/bin/bbackupd/BackupDaemon.cpp

    r1862 r1863  
    877877                                                conf.GetKeyValueInt( 
    878878                                                        "MaxFileTimeInFuture")); 
     879                                mDeleteRedundantLocationsAfter = 
     880                                        conf.GetKeyValueInt( 
     881                                                "DeleteRedundantLocationsAfter"); 
    879882 
    880883                                clientContext.SetMaximumDiffingTime(maximumDiffingTime); 
     
    16601663                i != rLocationsConf.mSubConfigurations.end(); ++i) 
    16611664        { 
    1662                 BOX_TRACE("new location"); 
     1665                BOX_TRACE("new location: " << i->first); 
    16631666                // Create a record for it 
    16641667                Location *ploc = new Location; 
     
    18221825                catch (std::exception &e) 
    18231826                { 
    1824                         delete ploc; 
    1825                         ploc = 0; 
    18261827                        BOX_ERROR("Failed to configure location '" 
    18271828                                << ploc->mName << "' path '" 
    18281829                                << ploc->mPath << "': " << e.what() << 
    18291830                                ": please check for previous errors"); 
     1831                        delete ploc; 
     1832                        ploc = 0; 
    18301833                        throw; 
    18311834                } 
     
    18581861                { 
    18591862                        mDeleteUnusedRootDirEntriesAfter = now +  
    1860                                 SecondsToBoxTime( 
    1861                                 BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER); 
     1863                                SecondsToBoxTime(mDeleteRedundantLocationsAfter); 
    18621864                } 
    18631865 
  • box/trunk/bin/bbackupd/BackupDaemon.h

    r1804 r1863  
    159159        std::vector<BackupClientInodeToIDMap *> mNewIDMaps; 
    160160         
     161        int mDeleteRedundantLocationsAfter; 
     162 
    161163        // For the command socket 
    162164        class CommandSocketInfo 
  • box/trunk/lib/backupclient/BackupDaemonConfigVerify.cpp

    r1234 r1863  
    7878 
    7979        {"MaximumDiffingTime", 0, ConfigTest_IsInt, 0}, 
     80        {"DeleteRedundantLocationsAfter", "172800", ConfigTest_IsInt, 0}, 
    8081 
    8182        {"FileTrackingSizeThreshold", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
  • box/trunk/lib/backupclient/BackupStoreConstants.h

    r217 r1863  
    4141#define BACKUP_FILE_DIFF_MAX_BLOCK_FIND_MULTIPLE        4096 
    4242 
    43 // How many seconds to wait before deleting unused root directory entries? 
    44 #ifndef NDEBUG 
    45         // Debug: 30 seconds (easier to test) 
    46         #define BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER         30 
    47 #else 
    48         // Release: 2 days (plenty of time for sysadmins to notice, or change their mind) 
    49         #define BACKUP_DELETE_UNUSED_ROOT_ENTRIES_AFTER         172800 
    50 #endif 
    51  
    5243#endif // BACKUPSTORECONSTANTS__H 
    5344