Exemplo n.º 1
0
def test_option_should_create_config_option_with_defaults():
    option = module.option('name')

    assert option == module.Config_option('name', str, True)
Exemplo n.º 2
0
def test_option_should_create_config_option():
    option = module.option('name', bool, required=False)

    assert option == module.Config_option('name', bool, False)
Exemplo n.º 3
0
def test_option_should_create_config_option():
    option = module.option('name', bool, required=False)

    assert option == module.Config_option('name', bool, False)
Exemplo n.º 4
0
def test_option_should_create_config_option_with_defaults():
    option = module.option('name')

    assert option == module.Config_option('name', str, True)
Exemplo n.º 5
0
from functools import partial

from atticmatic.config import Section_format, option
from atticmatic.backends import shared

# An atticmatic backend that supports Borg for actually handling backups.

COMMAND = 'borg'
CONFIG_FORMAT = (
    shared.CONFIG_FORMAT[0],  # location
    Section_format(
        'storage',
        (
            option('encryption_passphrase', required=False),
            option('compression', required=False),
        ),
    ),
    shared.CONFIG_FORMAT[2],  # retention
    Section_format(
        'consistency',
        (
            option('checks', required=False),
            option('check_last', required=False),
        ),
    )
)


initialize = partial(shared.initialize, command=COMMAND)
create_archive = partial(shared.create_archive, command=COMMAND)
prune_archives = partial(shared.prune_archives, command=COMMAND)
Exemplo n.º 6
0
from atticmatic.config import Section_format, option
from atticmatic.verbosity import VERBOSITY_SOME, VERBOSITY_LOTS


# Common backend functionality shared by Attic and Borg. As the two backup
# commands diverge, these shared functions will likely need to be replaced
# with non-shared functions within atticmatic.backends.attic and
# atticmatic.backends.borg.


CONFIG_FORMAT = (
    Section_format(
        'location',
        (
            option('source_directories'),
            option('repository'),
        ),
    ),
    Section_format(
        'storage',
        (
            option('encryption_passphrase', required=False),
        ),
    ),
    Section_format(
        'retention',
        (
            option('keep_within', required=False),
            option('keep_hourly', int, required=False),
            option('keep_daily', int, required=False),
Exemplo n.º 7
0
from functools import partial

from atticmatic.config import Section_format, option
from atticmatic.backends import shared

# An atticmatic backend that supports Borg for actually handling backups.

COMMAND = 'borg'
CONFIG_FORMAT = (
    Section_format(
        'location',
        (
            option('source_directories'),
            option('one_file_system', value_type=bool, required=False),
            option('repository'),
        ),
    ),
    Section_format(
        'storage',
        (
            option('encryption_passphrase', required=False),
            option('compression', required=False),
            option('umask', required=False),
        ),
    ),
    shared.CONFIG_FORMAT[2],  # retention
    Section_format(
        'consistency',
        (
            option('checks', required=False),
            option('check_last', required=False),