Skip to content

Instantly share code, notes, and snippets.

View soapsurfer's full-sized avatar

Sebastian soapsurfer

  • Germany, NRW
View GitHub Profile
@gbrks
gbrks / snapraid-sync
Last active November 3, 2024 15:56
SnapRAID sync and scrub: script and systemd timers to run nightly
#! /bin/bash
#######################################################################
# this is a helper script that keeps SnapRAID parity info in sync with
# your data. Here's how it works:
# 1) it first calls diff to figure out if the parity info is out of sync
# 2) if there are changed files (i.e. new, changed, moved or removed),
# it then checks how many files were removed.
# 3) if the deleted files exceed X (configurable), it triggers an
# alert email and stops. (in case of accidental deletions)
# 4) otherwise, it will call sync.