settings.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:ceph-backup 作者: teralytics 项目源码 文件源码
def start_backup(self):
        '''
        Read settings and starts backup
        '''
        for section in self._config.sections():
            # Run a backup for each section
            print "Starting backup for pool {}".format(section)
            images = self.getsetting(section, 'images').split(',')
            backup_dest = self.getsetting(section, 'destination directory')
            conf_file = self.getsetting(section, 'ceph config')
            check_mode = bool(strtobool(self.getsetting(section, 'check mode')))
            compress_mode = bool(strtobool(self.getsetting(section, 'compress')))
            window_size = int(self.getsetting(section, 'window size'))
            window_unit = self.getsetting(section, 'window unit')
            backup_mode = self.getsetting(section, 'backup mode')
            cb = CephFullBackup(section, images, backup_dest, conf_file, check_mode, compress_mode, window_size, window_unit)
            if backup_mode == 'full':
                print "Full ceph backup"
                cb.print_overview()
                cb.full_backup()
            elif backup_mode == 'incremental':
                print "Incremental ceph backup"
                cb.print_overview()
                cb.incremental_backup()
            else:
                raise Exception("Unknown backup mode: {}".format(backup_mode))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号