Skip to content

Commit

Permalink
Issue Chronial#3: align more with PR Chronial#15
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrekle committed Dec 12, 2019
1 parent e9e36d0 commit ff18695
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions snapraid-runner.conf.example
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
7 changes: 6 additions & 1 deletion snapraid-runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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...")
Expand Down

0 comments on commit ff18695

Please sign in to comment.