This script is based on the Chronial/snapraid-runner project and runs snapraid-btrfs, sending its output to the console, a log file and via email. All this is configurable.
It can be run manually, but its main purpose is to be run via cronjob or systemd unit.
Given the use of the BTRFS filesystem, this script is only supported on Linux. It requires at least python3.7.
- If you don’t already have it, download and install the latest python version.
- Clone this repository via git.
- Copy/rename the
snapraid-btrfs-runner.conf.exampletosnapraid-btrfs-runner.confand edit its contents. You need to at least configure the following configuration items:snapraid-btrfs.executablesnapper.executablesnapraid.executablesnapraid.config
- Run the script via
python3 snapraid-btrfs-runner.py.
See the init dir for a sample systemd timer for automatic scheduled runs.
Includes all the snapraid-runner features:
- Runs
diffbeforesyncto see how many files were deleted and aborts if that number exceeds a set threshold. - Can create a size-limited rotated logfile.
- Can send notification emails after each run or only for failures.
- Can run
scrubaftersync
Includes basic snapraid-btrfs features of taking BTRFS snapshots in conjunction with snapraid operations (i.e.
diff, sync, cleanup, and scrub). This script omits access to many underlying snapraid-btrfs options, given its intended
use as an unattended automatic snapraid tool. Features include:
- Uses
snapraid-btrfsfordiff,sync, andscruboperations - Can run
pooland/orcleanupbetweensyncandscrub
- Nothing for now
- Incorporated fixes from the upstream snapraid-runner project:
- Add
--ignore-deletethreshold(by exterrestris, #25) - Add support for scrub
--plan, replacing--percentage - Remove snapraid progress output. Was accidentially introduced with python3 support.
- Add
- Initial release
- Added optional
snapraid-btrfs poolandsnapraid-btrfs cleanupstep aftersync - Added config options for for
--snapper-configsand--snapper-configs-fileunderlying options in snapraid-btrfs.