Skip to content

Instantly share code, notes, and snippets.

@torusJKL
torusJKL / snapScript.sh
Created April 6, 2022 04:59
Bash helper script to help with the automation of routine snapRAID tasks. Add it as a cron job to automate the routine tasks of running sync and scrub. Script will optionally send you email of status and issues encountered during the run.
#!/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) Checks for size 0 .nfo files (plex)
# 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