This commit is contained in:
Jeff Bryner 2014-12-15 15:39:26 -08:00
Родитель 34b6fcb483
Коммит 2352b475e2
1 изменённых файлов: 16 добавлений и 16 удалений

Просмотреть файл

@ -27,21 +27,21 @@ def discover():
config_rotation = []
config_pruning = []
for index in indices.keys():
index_template = index
freq = 'none'
pruning = '0'
if re.search(r'-[0-9]{8}', index):
freq = 'daily'
pruning = '20'
index_template = index[:-9]
elif re.search(r'-[0-9]{6}', index):
freq = 'monthly'
index_template = index[:-7]
if index_template not in config_indices:
config_indices.append(index_template)
config_dobackup.append('1')
config_rotation.append(freq)
config_pruning.append(pruning)
index_template = index
freq = 'none'
pruning = '0'
if re.search(r'-[0-9]{8}', index):
freq = 'daily'
pruning = '20'
index_template = index[:-9]
elif re.search(r'-[0-9]{6}', index):
freq = 'monthly'
index_template = index[:-7]
if index_template not in config_indices:
config_indices.append(index_template)
config_dobackup.append('1')
config_rotation.append(freq)
config_pruning.append(pruning)
setConfig('backup_indices', ','.join(config_indices), options.configfile)
setConfig('backup_dobackup', ','.join(config_dobackup), options.configfile)
setConfig('backup_rotation', ','.join(config_rotation), options.configfile)
@ -83,4 +83,4 @@ if __name__ == '__main__':
help="configuration file to use")
(options, args) = parser.parse_args()
initConfig()
discover()
discover()