2015-07-19 03:35:29 +02:00
|
|
|
from functools import partial
|
|
|
|
|
2015-07-28 06:47:52 +02:00
|
|
|
from atticmatic.config import Section_format, option
|
2015-07-19 03:35:29 +02:00
|
|
|
from atticmatic.backends import shared
|
|
|
|
|
|
|
|
# An atticmatic backend that supports Borg for actually handling backups.
|
|
|
|
|
|
|
|
COMMAND = 'borg'
|
2015-07-28 06:47:52 +02:00
|
|
|
CONFIG_FORMAT = (
|
2016-02-13 19:43:31 +01:00
|
|
|
Section_format(
|
|
|
|
'location',
|
|
|
|
(
|
|
|
|
option('source_directories'),
|
|
|
|
option('one_file_system', value_type=bool, required=False),
|
|
|
|
option('repository'),
|
|
|
|
),
|
|
|
|
),
|
2015-09-03 07:48:07 +02:00
|
|
|
Section_format(
|
|
|
|
'storage',
|
|
|
|
(
|
|
|
|
option('encryption_passphrase', required=False),
|
|
|
|
option('compression', required=False),
|
2016-02-13 19:59:43 +01:00
|
|
|
option('umask', required=False),
|
2015-09-03 07:48:07 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
shared.CONFIG_FORMAT[2], # retention
|
2015-07-28 06:47:52 +02:00
|
|
|
Section_format(
|
|
|
|
'consistency',
|
|
|
|
(
|
|
|
|
option('checks', required=False),
|
|
|
|
option('check_last', required=False),
|
|
|
|
),
|
|
|
|
)
|
|
|
|
)
|
2015-07-19 03:35:29 +02:00
|
|
|
|
|
|
|
|
2015-09-03 07:48:07 +02:00
|
|
|
initialize = partial(shared.initialize, command=COMMAND)
|
2016-02-13 19:59:43 +01:00
|
|
|
|
2015-07-19 03:35:29 +02:00
|
|
|
create_archive = partial(shared.create_archive, command=COMMAND)
|
|
|
|
prune_archives = partial(shared.prune_archives, command=COMMAND)
|
|
|
|
check_archives = partial(shared.check_archives, command=COMMAND)
|