Skip to content

Commit

Permalink
Update default config to include snap_type
Browse files Browse the repository at this point in the history
  • Loading branch information
hirak99 committed May 9, 2024
1 parent 8df2a21 commit 4829bba
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ keep_weekly = 0
keep_monthly = 0
keep_yearly = 0

# Snapshot mechanism. Only BTRFS is supported as of now.
snap_type = BTRFS

# Uncomment example to specify scripts to run after yabsnap creates or deletes any snap.
# Use space as delimiter to specify multiple scripts if desired.
# If any creation / deletion operation occurs, each script will be called once.
Expand Down
6 changes: 3 additions & 3 deletions src/code/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,10 @@ def from_configfile(cls, config_file: str) -> "Config":
if key == "post_transaction_scripts":
result.post_transaction_scripts = shlex.split(value)
continue
if key == "snapshot_type":
if key == "snap_type":
if not value:
value = "btrfs"
result.snap_type = snap_mechanisms.SnapType[value.upper()]
value = "BTRFS"
result.snap_type = snap_mechanisms.SnapType[value]
continue
if not hasattr(result, key):
logging.warning(f"Invalid field {key=} found in {config_file=}")
Expand Down
3 changes: 3 additions & 0 deletions src/code/example_config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ keep_weekly = 0
keep_monthly = 0
keep_yearly = 0

# Snapshot mechanism. Only BTRFS is supported as of now.
snap_type = BTRFS

# Uncomment example to specify scripts to run after yabsnap creates or deletes any snap.
# Use space as delimiter to specify multiple scripts if desired.
# If any creation / deletion operation occurs, each script will be called once.
Expand Down

0 comments on commit 4829bba

Please sign in to comment.