digint / digint/btrbk

Add pre/post snapshot command

Open
#58 8 comments 2 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
2.1k
Forks
139
PR merge metrics
No merged PRs in 30d

Description

It would be great to have a way to execute a command before / after creating or deleting a snapshot. This command should have as argument the name of the snapshot(s) that have been deleted.

I use btrbk to backup my SSD drive to my HDD. However, I would like to be able to boot my HDD with the last backup snapshot in case my SSD fails. To do so, I can create a writable snapshot of the HDD and replace the /etc/fstab so that it contains the HDD drive using a shell script. This script then only needs to be called by btrbk for the root subvolume with the path of the backup as an argument.

I can develop the functionality and submit a pull request if you think it would be useful to others. I am sure there are many more use cases where this can be used. I can also submit the script once it's well tested.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by tracing btrbk’s root-subvolume backup flow and the points where snapshots are created or deleted. Clarify the hook configuration and command arguments, including how multiple deleted snapshot names are passed; done means pre- and post-commands run reliably for both operations and the requested snapshot names are available to the script.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl
Domain
cli, devops, operating-systems
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.