You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+38-14Lines changed: 38 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,11 @@
1
1
# Snapraid AIO Script
2
-
The definitive all-in-one [SnapRAID](https://github.com/amadvance/snapraid) script. I hope you'll agree :).
2
+
The definitive all-in-one [SnapRAID](https://github.com/amadvance/snapraid) script on Linux. I hope you'll agree :).
3
3
4
4
There are many SnapRAID scripts out there, but none has the features I want. So I made my own, inspired by existing solutions.
5
5
6
6
It is meant to be run periodically (daily), do the heavy lifting and send an email you will actually read.
7
7
8
-
Supports single and dual parity configurations. It is highly customizable and has been tested with Debian 10/11 and [OpenMediaVault 5/6](https://github.com/openmediavault/openmediavault).
8
+
Supports single and dual parity configurations. It is highly customizable and has been tested with Debian 11/12 and [OpenMediaVault 6/7](https://github.com/openmediavault/openmediavault).
9
9
10
10
Contributions are welcome!
11
11
@@ -20,7 +20,7 @@ Contributions are welcome!
20
20
-[Requirements](#requirements)
21
21
-[Installation](#installation)
22
22
*[First Run](#first-run)
23
-
*[OMV5/6 and SnapRAID plugin](#omv56-and-snapraid-plugin)
23
+
*[OMV and SnapRAID plugin](#omv6-and-snapraid-plugin)
- You can either choose to pause or stop your containers.
51
51
- Custom Hooks
52
52
- Define shell commands or scripts to run before and after SnapRAID operations.
53
+
- Multiple configuration files
54
+
- Use a different configuration file when running the script instead of the default config
53
55
- 3rd Party notification support
54
56
- [Healthchecks.io](https://healthchecks.io), Telegram and Discord can be used to track script execution time, status and promptly alert about errors.
55
-
- Notification Hook: if your favourite notification service is not supported by this script, you can use a custom notification command or even another mail binary
57
+
- You can also get notified with the `Snapraid SMART log` and `Snapraid Status`
58
+
- Notification Hook: if your favourite notification service is not supported by this script, you can use a custom notification command or another mail binary
56
59
- Important messages are also sent to the system log.
57
60
- Emails are still the best place to get detailed but readable information.
58
61
@@ -72,10 +75,12 @@ If you don't know what to do, I recommend using the default values and see how i
72
75
- Delayed option, disabled by default. Run scrub only after a number of script executions, e.g. every 7 times. If you don't want to scrub your array every time, this one is for you.
73
76
- Data to be scrubbed - by default 5% older than 10 days.
74
77
- Scrub new data - scrub the data that was just added by the sync.
75
-
- Pre-hashing - enabled by default. Mitigate the lack of ECC memory, reading data twice to avoid silent read errors.
78
+
- Pre-hashing - enabled by default. Mitigates the lack of ECC memory, reading data twice to avoid silent read errors.
76
79
- Force zero size sync - disabled by default. Forces the operation of syncing a file with zero size that before was not. Use with caution!
77
-
- Snapraid Status - shows the status of the array, disabled by default.
80
+
- Snapraid Status - disabled by default. Shows the status of the array.
81
+
- This info can also be sent to Telegram or Discord
78
82
- SMART Log - enabled by default. A SnapRAID report for disks health status.
83
+
- This info can also be sent to Telegram or Discord
79
84
- Verbosity option - disabled by default. When enabled, includes the TOUCH and DIFF commands output. Please note email will be huge and mostly unreadable.
80
85
- SnapRAID Output (log) retention - disabled by default (log is overriden every run)
81
86
- Detailed output retention for each run
@@ -89,11 +94,16 @@ If you don't know what to do, I recommend using the default values and see how i
89
94
- Made for external services or mail binaries with different commands than `mailx`.
90
95
- Configure the path of the script or the mail binary to be invoked.
91
96
- You can still use native services since it only replaces the standard email.
97
+
- Update Check - enabled by default
98
+
- The script will check via GitHub if there's an update and alert the user via the configured notification systems
99
+
- If you don't like this, it can be disabled
92
100
- Docker Container management
93
101
- A list of containers you want to be interrupted before running actions and restored when completed.
94
102
- Docker mode - choose to pause/unpause or to stop/restart your containers
95
103
- Docker remote - if docker is running on a remote machine
96
-
- Docker remote action delay - Set by default to 10 seconds, reduces errors when using remote docker
104
+
- Multiple Configuration files
105
+
- By default the script will use the predefined config file `script-config.sh` that must be placed in the same folder
106
+
- You can specify another file when running the script like `snapraid-aio-script.sh /home/alternate_config.sh`
97
107
- Custom Hooks
98
108
- Commands or scripts to be run before and after SnapRAID operations.
99
109
- Option to display friendly name to in the email output
@@ -258,15 +268,22 @@ Email address is set. Sending email report to yourmail@example.com [Tue 20 Apr 1
258
268
```
259
269
260
270
# Requirements
261
-
-[`markdown`](https://packages.debian.org/buster/python3-markdown) to format emails - will be installed if not found
271
+
272
+
If you are running a Debian based distro (with `apt` package manager) the script will automatically install these dependencies for you.
273
+
-[`python3-markdown`](https://packages.debian.org/bullseye/python3-markdown) to format emails - will be installed if not found
262
274
-`curl` to use Healhchecks - will be installed if not found
275
+
-[`jq`](https://packages.debian.org/bullseye/jq) - used to send discord notifications, is a lightweight and flexible command-line JSON processor
276
+
-[`bc`](https://packages.debian.org/bullseye/bc) - used for for floating-point comparisons
277
+
278
+
279
+
Dependencies that require manual installation:
263
280
-`hd-idle` to spin down disks - [Link](https://github.com/adelolmo/hd-idle), installation instructions [below](#installing-hd-idle-for-automatic-disk-spindown)
264
281
265
282
# Installation
266
283
267
-
_Optional: install markdown `apt install python-markdown` and curl `apt install curl` . You can skip this step since the script will try to install missing packages for you._
268
284
269
-
1. Download the latest version from [Releases](https://github.com/auanasgheps/snapraid-aio-script/releases)
285
+
1. Install the packages listed in the Requirements section if you're not running a distro with `apt` package manager
286
+
2. Download the latest version from [Releases](https://github.com/auanasgheps/snapraid-aio-script/releases)
- When you see `""` or `''` in some options, do not remove these characters but just fill in your data.
277
294
- If you want to spindown your disks, you need to install [hd-idle](https://github.com/adelolmo/hd-idle)
278
295
6. Schedule the script execution.
279
-
- I recommend running the script daily.
296
+
- I recommend running the script daily.
297
+
298
+
**TIP**: To use multiple config files, you can create different schedules. Just append the config file path after the script, like `snapraid-aio-script.sh /home/alternate_config.sh`
299
+
300
+
It is tested on OMV6 and OMV7, but will work on other distros. In such case you may have to change the mail binary or SnapRAID location.
301
+
302
+
### OMV7 USERS
303
+
OMV7's SnapRAID plugins introduced support for multiple arrays. This means each SnapRAID config file does not have a predictable name, unlike what occurred with OMV6 or standard SnapRAID installs.
304
+
If running on OMV7, the AIO Script will search for a SnapRAID configuration file in the new path `/etc/snapraid/`. If multiple arrays are found, it will inform you to adjust your configuration.
280
305
281
-
It is tested on OMV5/6, but will work on other distros. In such case you may have to change the mail binary or SnapRAID location.
282
306
283
307
## First Run
284
308
If you start with empty disks, you cannot use (yet) this script, since it expects SnapRAID files which would not be found.
285
309
286
310
First run `snapraid sync`. Once completed, the array will be ready to be used with this script.
287
311
288
-
## OMV5/6 and SnapRAID plugin
312
+
## OMV and SnapRAID plugin
289
313
Ignore what you see at _OMV GUI > Services > SnapRAID > Diff Script Settings_, since it only applies to the plugin's built-in script. Also don't forget to remove the built-in `omv-snapraid-diff` job from _OMV GUI > System > Scheduled Tasks_, either by deleting the job, or simply disabling it.
290
314
291
315
## Installing `hd-idle` for Automatic Disk Spindown
0 commit comments