Skip to content

Instantly share code, notes, and snippets.

View thenomadcode's full-sized avatar

The Nomad Code thenomadcode

  • The Nomad Code
  • Barcelona
  • 17:34 (UTC +02:00)
View GitHub Profile
@thenomadcode
thenomadcode / snapraidsync.sh
Created February 3, 2023 17:17
Snapraid Sync script from Zack Reed, slightly modified to send Slack notifications
#!/bin/bash
#######################################################################
# This is a helper script that keeps snapraid parity info in sync with
# your data and optionally verifies the parity info. Here's how it works:
# 1) Shuts down configured services
# 2) Calls diff to figure out if the parity info is out of sync.
# 3) If parity info is out of sync, AND the number of deleted or changed files exceed
# X (each configurable), it triggers an alert email and stops. (In case of
# accidental deletions, you have the opportunity to recover them from