diff --git a/README.md b/README.md index e0495d6..fbbc92f 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,15 @@ It supports Windows, Linux and macOS and runs on both python2 and python3. * Can create a size-limited rotated logfile. * Can send notification emails after each run or only for failures. * Can run `scrub` after `sync` +* Can run `smart`. For this to work, you need [smartmontools](https://www.smartmontools.org/wiki/Download). + Most Linux distributions will have it installed installed by default. + * Windows users may install using the packaged .exe installer found at this link or + use [Chocolatey](https://chocolatey.org/) (i.e., `choco install smartmontools`). + * Mac OS users may install using the packaged .dmg installer found at this link or + use [Homebrew](https://brew.sh/) (i.e., `brew install smartmontools`). + * Linux users may check for smartmontools using `smartctl -V`, if not installed use + your distribution's package manager to install `smartmontools` + (e.g., `apt-get install smartmontools`, `yum install smartmontools`, etc.) ## Changelog ### v0.4 (17 Aug 2019) diff --git a/snapraid-runner.conf.example b/snapraid-runner.conf.example index 5c6cf6f..32a7bc4 100644 --- a/snapraid-runner.conf.example +++ b/snapraid-runner.conf.example @@ -7,6 +7,7 @@ config = snapraid.conf deletethreshold = 40 ; if you want touch to be ran each time touch = false +; prints a SMART report of all the disks of the array. smart = true [logging] diff --git a/snapraid-runner.py b/snapraid-runner.py index bd28be9..44b013b 100644 --- a/snapraid-runner.py +++ b/snapraid-runner.py @@ -165,6 +165,7 @@ def load_config(args): config["scrub"]["enabled"] = (config["scrub"]["enabled"].lower() == "true") config["email"]["short"] = (config["email"]["short"].lower() == "true") config["snapraid"]["touch"] = (config["snapraid"]["touch"].lower() == "true") + config["snapraid"]["smart"] = (config["snapraid"]["smart"].lower() == "true") if args.scrub is not None: config["scrub"]["enabled"] = args.scrub @@ -261,7 +262,11 @@ def run(): logging.info("*" * 60) if config["snapraid"]["smart"]: logging.info("Running smart...") - snapraid_command("smart", log_output=True) + try: + snapraid_command("smart", log_output=True) + except subprocess.CalledProcessError as e: + logging.error(e) + finish(False) logging.info("*" * 60) logging.info("Running diff...")