diff -r f9ce2442f14f -r fdfbe5d7b677 backup.py --- a/backup.py Sat Jan 20 23:19:16 2018 +0000 +++ b/backup.py Sat Jan 20 23:50:36 2018 +0000 @@ -5,6 +5,7 @@ import config import logging import time +import keyring from instance import BorgInstance from queue import Queue from threading import Thread, Lock, Timer @@ -71,6 +72,15 @@ 'Prune parameters', self.loc, default=[]) + keychain_account=config.check_string(cfg, 'keychain_account', + 'Keychain account', self.loc, + default='') + + if keychain_account and keychain_account!='': + pw=keyring.get_password("borg-backup", keychain_account) + self.__password=pw + else: + self.__password=None def __init__(self, identifier, cfg): self.identifier=identifier @@ -212,7 +222,7 @@ def __do_launch(self, queue, op, archive_or_repository, *args): inst=BorgInstance(op['operation'], archive_or_repository, *args) - inst.launch() + inst.launch(password=self.__password) t_log=Thread(target=self.__log_listener) t_log.daemon=True