NumberSix
Contributor
- Joined
- Apr 9, 2021
- Messages
- 188
Hi
Is it possible to send a command from windows to Truenas, originating in a windows batch file, that will tell TrueNAS to close down gracefully, in the same manner that a UPS might signal it to do so? (and to push my luck, of restarting it when power resumes?).
The reason I ask: I have a great little freeware app called "WTUPS" which runs as a Windows daemon, listening to my UPS. If it gets a battery problem signal, the daemon shuts down everything attached to Windows (chiefly my Netgear ReadyNAS), then closes down a server process I run on Windows, before finally closing down Windows itself. It does this by running one of two windows .bat files (one for power going down, one for back up) that contain commands like the following :
So I reason that it must be possible to add TrueNAS to this list? Either with a command that addresses TrueNAS itself, or the underlaying BSD OS, and tells it to go sleepytime? I'm adept with neither TrueNAS nor BSD (nervous noobie) and just feeling my way at the moment, but if someone nearer guru status knows what I'm asking and can supply an answer I'd be thrilled! Thank you!!
Is it possible to send a command from windows to Truenas, originating in a windows batch file, that will tell TrueNAS to close down gracefully, in the same manner that a UPS might signal it to do so? (and to push my luck, of restarting it when power resumes?).
The reason I ask: I have a great little freeware app called "WTUPS" which runs as a Windows daemon, listening to my UPS. If it gets a battery problem signal, the daemon shuts down everything attached to Windows (chiefly my Netgear ReadyNAS), then closes down a server process I run on Windows, before finally closing down Windows itself. It does this by running one of two windows .bat files (one for power going down, one for back up) that contain commands like the following :
Code:
@echo off rem Define the commands for the tool to execute in case of a power outage rem Examples rem Shut down a remote Windows system in 5 minutes from now rem shutdown -f -s -t 300 -m \\HOSTNAME rem Shut down a remote linux system in 5 minutes from now rem plink -ssh -pw PASSWORD USERNAME@HOSTNAME /sbin/shutdown -h +5 rem Shut down local systems start "" "C:\OPENSIM\Shutdownsequence.exe" TIMEOUT /T 90 /nobreak shutdown -a sleep 1 shutdown -f -s -t 0
So I reason that it must be possible to add TrueNAS to this list? Either with a command that addresses TrueNAS itself, or the underlaying BSD OS, and tells it to go sleepytime? I'm adept with neither TrueNAS nor BSD (nervous noobie) and just feeling my way at the moment, but if someone nearer guru status knows what I'm asking and can supply an answer I'd be thrilled! Thank you!!