JoeSchmuck / Multi-Report

FreeNAS/TrueNAS Script for emailed drive information.
43 stars 0 forks source link

Preventing waking up sleeping Drives #4

Open Grinchii opened 1 month ago

Grinchii commented 1 month ago

Hello,

first of all, thank you for this great script!

Would there be a way to integrate something to prevent booting up the Drives that are in Standby while executing this Script?

I'm using this Script to Send the Report about every 3h, so it kind of prevents my drives to go to sleep.

smartctl -i -n standby should work in this case.

Thank you!

JoeSchmuck commented 1 month ago

Yes this could be included however let me sleep on it a bit. I don't really have a problem including it, however I am trying to slim the script down a bit and it is taking a lot longer than I expected. And I need to put out a survey and hope people respond with what features are not being used so those can go away.

How many drives do you have? If it is only a few, you could write your own little script just for yourself (how FreeNAS-Report came about for me decades ago).

Example: Call the file "sleep_my_drives.sh"

!/bin/bash

smartctl -i -n standby /dev/ada0 smartctl -i -n standby /dev/ada1 smartctl -i -n standby /dev/ada2 smartctl -i -n standby /dev/ada3

Since you should only need to run this once upon bootstrap, put this into the Init/Shutdown Scripts area of TrueNAS so this command can be run after the NAS starts up.

If you have several dozen drives, there is a nicer way to loop all the drives but lets start with simple first.

And thanks for the interest in Multi-Report. I hope one day that TrueNAS will have all the features so my script will be obsolete. That is the goal at least.

Feel free to reach out to me directly if you desire at joeschmuck2023@gmail.com and we can share ideas and I can help you out where needed.