Scheduled shutdown

Is there any way to configure scheduled shutdown of the TrueNAS ?
I believe the easiest way would be to make a cron job, but when entering CLI i see this warning:

“Warning: the supported mechanisms for making configuration changes
are the TrueNAS WebUI, CLI, and API exclusively. ALL OTHERS ARE
NOT SUPPORTED AND WILL RESULT IN UNDEFINED BEHAVIOR AND MAY
RESULT IN SYSTEM FAILURE.”

So it looks like cron is not the best option. Any other options?

Use the WebUI to schedule it.

the api call would be:

/usr/bin/midclt call system.shutdown

if i’m not mistaken

Edit: fixed path problem

You can use the cron jobs for it.

For Shutdown - midclt call system.shutdown
For Reboot - midclt call system.reboot

Used those commands in the past without any issues with scheduling.

3 Likes

@itsharryshelton thank you! it’s working!

1 Like