|
|
|
@ -23,35 +23,36 @@ CONFIG_BASENAME = 'zasd.conf.py' |
|
|
|
|
CONFIG_FILENAMES = [CONFIG_BASENAME, '.' + CONFIG_BASENAME] |
|
|
|
|
|
|
|
|
|
# Default configuration |
|
|
|
|
DEFAULT_CONFIG = { |
|
|
|
|
'zfs_path': '/usr/local/bin/zfs', |
|
|
|
|
'fswatch_path': '/usr/local/bin/fswatch', |
|
|
|
|
DEFAULT_CONFIG = dict( |
|
|
|
|
zfs_path = '/usr/local/bin/zfs', |
|
|
|
|
fswatch_path = '/usr/local/bin/fswatch', |
|
|
|
|
|
|
|
|
|
'tab_size': 2, |
|
|
|
|
tab_size = 2, |
|
|
|
|
|
|
|
|
|
'log_level': logging.INFO, |
|
|
|
|
'log_format': '%(asctime)s %(name)s [%(levelname)-8s]: %(message)s', |
|
|
|
|
'log_date_format': '%a, %d %b %Y, %H:%M:%S', |
|
|
|
|
log_level = logging.INFO, |
|
|
|
|
log_format = '%(asctime)s %(name)s [%(levelname)-8s]: %(message)s', |
|
|
|
|
log_date_format = '%a, %d %b %Y, %H:%M:%S', |
|
|
|
|
|
|
|
|
|
'separator': ':', |
|
|
|
|
'destroy_trigger': CronTrigger.from_crontab('* * * * *'), |
|
|
|
|
separator = ':', |
|
|
|
|
destroy_trigger = CronTrigger.from_crontab('* * * * *'), |
|
|
|
|
|
|
|
|
|
# Defaults will take a snapshot every 12 hours |
|
|
|
|
# and keep them for a week, so if the config file |
|
|
|
|
# should disappear for some reason, there will |
|
|
|
|
# at least be _some_ recoverable snapshots |
|
|
|
|
'defaults': { |
|
|
|
|
'disabled': False, |
|
|
|
|
'filesystems': ['tank'], |
|
|
|
|
'recursive': True, |
|
|
|
|
'tag': 'zasd', |
|
|
|
|
'trigger': IntervalTrigger(hours=12), |
|
|
|
|
'priority': 1, |
|
|
|
|
'keep': 14 |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
'schedules': [{}] |
|
|
|
|
} |
|
|
|
|
defaults = dict( |
|
|
|
|
disabled = False, |
|
|
|
|
filesystems = ['tank'], |
|
|
|
|
recursive = True, |
|
|
|
|
tag = 'zasd', |
|
|
|
|
trigger = IntervalTrigger(hours=12), |
|
|
|
|
if_modified = False, |
|
|
|
|
priority = 1, |
|
|
|
|
keep = 14 |
|
|
|
|
), |
|
|
|
|
|
|
|
|
|
schedules = [{}] |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# Load configuration |
|
|
|
|
def load_config(): |
|
|
|
|