Compare commits

...

3 Commits

  1. 72
      src/config.py
  2. 44
      src/zasd.conf.example.py

@ -1,72 +0,0 @@
from apscheduler.triggers.cron import CronTrigger
import logging
config = {
# 'zfs_path': '/usr/local/bin/zfs',
# 'fswatch_path': '/usr/local/bin/fswatch',
# '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',
# 'separator': ':',
# 'destroy_trigger': CronTrigger.from_crontab('* * * * *'),
# 'defaults': {
# 'disabled': False,
# 'filesystems': ['Media', 'Volatile'],
'recursive': True,
'tag': '',
'trigger': CronTrigger.from_crontab('0 0 * * *'),
'priority': 1,
'keep': 6
},
'schedules': [
{
'disabled': True,
'tag': '1mi',
'trigger': CronTrigger.from_crontab('* * * * *'),
'priority': 7,
'keep': 4
},
{
'tag': '5mi',
'trigger': CronTrigger.from_crontab('*/5 * * * *'),
'priority': 6,
'keep': 4
},
{
'tag': '20m',
'trigger': CronTrigger.from_crontab('*/20 * * * *'),
'priority': 5,
'keep': 3
},
{
'tag': '1hr',
'trigger': CronTrigger.from_crontab('0 * * * *'),
'priority': 4,
'keep': 6
},
{
'tag': '6hr',
'trigger': CronTrigger.from_crontab('0 */6 * * *'),
'priority': 3,
'keep': 4
},
{
'tag': '1dy',
'trigger': CronTrigger.from_crontab('0 0 * * *'),
'priority': 2,
'keep': 7
},
{
'tag': '1wk',
'trigger': CronTrigger.from_crontab('0 0 * * mon'),
'priority': 1,
'keep': 4
}
]
}

@ -12,18 +12,38 @@
# Field separator in snapshot names (':' gives 'dataset@tag:serial')
#separator = ':'
# How frequently to prune expired snapshots
# Polling interval for expired snapshot destructor
#destroy_trigger = cron('* * * * *')
# Default settings for a schedule
#defaults = dict(
defaults = dict(
# Unique snapshot tag for schedule
# tag = 'zasd',
# Whether the schedule should be executed
# disabled = False,
# Datasets to watch (must have mountpoints)
# filesystems = ['tank'],
# Whether to watch child datasets
# recursive = True,
# Time trigger for snasphot
# trigger = every(hours=12),
# Whether to ignore triggers on filesystems whose files
# have not been modifed since the trigger was last fired
# if_modified = False,
# Priority for snapshot; if more than one trigger fires
# at once on the same filesystem, the trigger with the
# highest priority wins out
# priority = 1,
# keep = 14)
# The maximum number of snapshots kept at any given time
# keep = 14
)
# The simplest possible schedule list possible sets up a single
# schedule with the default settings
@ -36,19 +56,22 @@ schedules = [
tag = '5mi',
trigger = cron('*/5 * * * *'),
priority = 6,
keep = 4),
keep = 4
),
dict(
tag = '20m',
trigger = cron('*/20 * * * *'),
priority = 5,
keep = 3),
keep = 3
),
dict(
tag = '1hr',
trigger = cron('0 * * * *'),
priority = 4,
keep = 6),
keep = 6
),
dict(
tag = '6hr',
@ -60,10 +83,13 @@ schedules = [
tag = '1dy',
trigger = cron('0 0 * * *'),
priority = 2,
keep = 7),
keep = 7
),
dict(
tag = '1wk',
trigger = cron('0 0 * * mon'),
priority = 1,
keep = 4)]
keep = 4
)
]

Loading…
Cancel
Save