borgend.py

Fri, 19 Jan 2018 15:41:45 +0000

author
Tuomo Valkonen <tuomov@iki.fi>
date
Fri, 19 Jan 2018 15:41:45 +0000
changeset 4
d72c4844e791
parent 3
4cad934aa9ce
child 8
7b2d2eac6a48
permissions
-rwxr-xr-x

Better borg output processing and some logging

#!/usr/local/bin/python3

import logging

logging.basicConfig(#filename='example.log',
                    format='%(levelname)s:%(message)s',
                    level=logging.DEBUG)

from backup import Backup
from config import settings
from queue import Queue
import ui

if __name__ == "__main__":
    #print(settings)
    #BorgendTray("Borgend").run()
    pass

backupconfigs=settings['backups']
backups=[None]*len(backupconfigs);

for i in range(len(backupconfigs)):
    logging.info('Setting up backup set %d' % i)
    backups[i]=Backup(i, backupconfigs[i])

queue=Queue()
backups[0].create(queue)

backups[0].join()

mercurial