(self, configName)
Constructor
Constructor
Constructor
def __init__(self, configName):
        """ Constructor """

        # Global configuration
        self.configName = configName
        self.key = None
        self.repositoryPath = None
        self.repositoryMounted = False
        self.mountPath = None
        self.archivePrefix = 'homebox-'

        # Save backup stdout/stderr for reporting
        # the keys will be create, prune, check or restore
        self.lastBackupInfo = {}

        # Read the domain configuration
        self.config = ConfigParser()
        self.config.read('/etc/homebox/backup.ini')

        # Read default / global configuration
        self.alerts_from = self.config.get('alerts', 'from')
        self.alerts_recipient = self.config.get('alerts', 'recipient')
        self.alerts_jabber = self.config.getboolean('alerts', 'jabber')

        # Read active configuration
        self.url = self.config.get(configName, 'url')
        self.location = urlparse(self.url)

        # Read the compression scheme to use, or use lz4 by default
        self.compression = self.config.get(configName, 'compression')

        # Get frequency options
        self.keepDaily = self.config.get(configName, 'keep_daily')
        self.keepWeekly = self.config.get(configName, 'keep_weekly')
        self.keepMonthly = self.config.get(configName, 'keep_monthly')

        # Read rate limiting option
        try:
            self.rateLimit = self.config.get(configName, 'rate_limit')
        except:
            self.rateLimit = None

        # The running file used for all backups
        self.globalRunFilePath = '/run/backup-homebox'

        # Check if the backup is active
        self.active = self.config.getboolean(configName, 'active')

        # Save the process information here
        self.runFilePath = '/run/backup-' + self.configName
def __init__ ( self , configName ) : # Global configuration self . configName = configName self . key = None self . repositoryPath = None self . repositoryMounted = False self . mountPath = None self . archivePrefix = 'homebox-' # Save backup stdout/stderr for reporting # the keys will be create, prune, check or restore self . lastBackupInfo = { } # Read the domain configuration self . config = ConfigParser ( ) self . config . read ( '/etc/homebox/backup.ini' ) # Read default / global configuration self . alerts_from = self . config . get ( 'alerts' , 'from' ) self . alerts_recipient = self . config . get ( 'alerts' , 'recipient' ) self . alerts_jabber = self . config . getboolean ( 'alerts' , 'jabber' ) # Read active configuration self . url = self . config . get ( configName , 'url' ) self . location = urlparse ( self . url ) # Read the compression scheme to use, or use lz4 by default self . compression = self . config . get ( configName , 'compression' ) # Get frequency options self . keepDaily = self . config . get ( configName , 'keep_daily' ) self . keepWeekly = self . config . get ( configName , 'keep_weekly' ) self . keepMonthly = self . config . get ( configName , 'keep_monthly' ) # Read rate limiting option try : self . rateLimit = self . config . get ( configName , 'rate_limit' ) except : self . rateLimit = None # The running file used for all backups self . globalRunFilePath = '/run/backup-homebox' # Check if the backup is active self . active = self . config . getboolean ( configName , 'active' ) # Save the process information here self . runFilePath = '/run/backup-' + self . configName