--- a/borgend.py Fri Jan 26 10:35:00 2018 +0000 +++ b/borgend.py Fri Jan 26 19:04:04 2018 +0000 @@ -42,6 +42,7 @@ import config from scheduler import Scheduler from fifolog import FIFOHandler +from repository import Repository # # Argument processing @@ -80,6 +81,7 @@ # Parse args. Let argparse handle errors/exit if there are any args= do_args() tray = None + repos=[] backups=[] try: @@ -105,6 +107,13 @@ scheduler = Scheduler() scheduler.start() + repoconfigs=config.settings['repositories'] + + for i in range(len(repoconfigs)): + logger.info('Setting up repository %d' % i) + r=Repository(i, repoconfigs[i]) + repos.append(r) + backupconfigs=config.settings['backups'] for i in range(len(backupconfigs)): @@ -112,6 +121,9 @@ b=Backup(i, backupconfigs[i], scheduler) backups.append(b) + for r in repos: + r.start() + for b in backups: b.start() @@ -133,6 +145,9 @@ for b in backups: b.terminate() + for r in repos: + r.terminate() + if tray: tray.quit() else: