smart test cron job on minutes, not only hours

Benni.blanko

Dabbler
Joined
Dec 18, 2021
Messages
31
hi TrueNAS friends,
how do I schedule a SMART job on jobs with minutes, not only to the full hour?
The field for the minutes is missing in 12U8 (does it even exist in previous versions?).

However I'm looking to schedule (for example) a short SMART test on 23:55. Mainly because the replication task start at the next full hour (0:00)

Thanks
 

Alecmascot

Guru
Joined
Mar 18, 2014
Messages
1,177
write a script to start the SMART tests and you can set the minutes there.
smartctl -t short /dev/daX
 

Benni.blanko

Dabbler
Joined
Dec 18, 2021
Messages
31
So you recommend to disable the default smart job and replace it with a manual one?
okay, that's easy ...

Thanks
 

awasb

Patron
Joined
Jan 11, 2021
Messages
415
You could also enable a custom script and fill the hours field with something like

Code:
*/15


This would start a (preferably short) test every 15mins. It's plain cron-syntax AFAIK.
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
you could also put the smart job at 00:00 and the replications to 05 * * *.
I was a bit surprised to look and see that it does, indeed, not have a minutes cron portion. seems like a silly thing to remove.
ultimately, having them run at the same time won't really matter much.
 

Benni.blanko

Dabbler
Joined
Dec 18, 2021
Messages
31
As this is on a backup box, that will auto-poweron at 23:50 each day, I'd like to schedule the short smart check once a week a 23:55.
BTW: when I run the smartctl-t /dev/xxx command, does this trigger the TrueNAS email notifications if something is wrong with the disks?
Or can I replace the smartctl -t command with the call to the "original" Truenas script? What's the filename to run? parameters?
I couldn't figure that out, where and how truenas is starting that.
Or indeed I can move the replication jobs from their default 00:00 to 5 minutes after that.
Thanks
 

artlessknave

Wizard
Joined
Oct 29, 2016
Messages
1,506
TrueNAS is starting it using the middleware, there is no "Script", the management software does it.
as you are trying to bypass the management middleware, you will pretty much have to custom write and maintain everything.
I *think* the alerts will pickup on any smart error on the system, but I am not sure.
you could put in a feature request for minutes granularity in smart schedules.

many people think turning their drives off and on each day is better for power but, unless the rest of the system is a complete power hog, you dont really save anything in the constant spin ups, plus, many drives dont handle constant spin ups well, and will die faster, particularly NAS/enterprise drives designed to be online all the time.

ultimately, I'm pretty sure your daily spinups and downs will probably cause more damage than just running the replication and smart at the same time. smart isn't supposed to affect the disks performance anyway. maybe if it was a long, but running a long smart daily is silly.
 
Last edited:
Top