/sbin/shutdown -p now
at the desired time.Shutdown is simple. Create a cron job that executes/sbin/shutdown -p now
at the desired time.
But how do you expect TrueNAS to wake up a system when TrueNAS is not running because the system is switched off?
You have in my experience two alternatives:
1. Wake on LAN
This needs to be supported by the hardware and you need a separate system to send a WoL packet to your TrueNAS. Very dependent on manufacture/mainboard/etc.
2. Clocked power switch
Most systems have an option in the BIOS that defines how the system should react after a power loss. With options "off", "on" and "last state". You could set that to "on" and use a timer to switch off the power, say, half an hour after your clean shutdown via cron job (see above), then restore power at the desired wake up time.
HTH,
Patrick
... Two of these I want them to start and shut down automatically at specific times.
Can I set these settings somewhere?
power on
command to my Backup server once a week. When the Backup server boots, it does a Snapshot Pull from my Main server and on completion shutsdown.ipmitool -I lanplus -H <IP-Address> -U <Username> -P <Password> power on
Yes I think IPMI is a way to go for the OP. The source I hinted at above is also using IPMI. In my home network I have a Raspberry Pi running as a VPN server. Just for the experience I will see if I can install IPMI tool on it and let it run a job to run a start script for my lab server.You can use IPMI!
Ha. I’d never, ever, have my IPMI connected to the general home network.
I agree. But with my "home network" I mean the whole shabang of managed switches and Vlan's and what not. Networking is not my thing, I am a humble software engineer, but luckely I have a friend who makes a living with designing and implementing bussiness networks. If anything goes belly up I can always blame him for doing a crappy job in advizing and helping meHa. I’d never, ever, have my IPMI connected to the general home network.
I don’t follow this logic. In my use case, I almost never have to use the IPMI interface. I think the last time I “needed” access to it had to do with setting up the fan speeds inside the case.Well I guess it just depends on the value you place on security vs. ease-of-use.
I don’t follow this logic.
But even better is leaving it disconnected unless there is a constant use case.
You can use IPMI!
I have two TrueNAS servers, a "Main" and a "Backup". I have a Cron script on my Main server that sends an IPMIpower on
command to my Backup server once a week. When the Backup server boots, it does a Snapshot Pull from my Main server and on completion shutsdown.
I'd have to look up the exact commands that I used, but it's pretty simple. You just 'Connect' to the offline sever's static (IPMI) IP address and issue the 'Power On' command. The only caveat is that you need to have two LAN cables connected to the Offline machine - one to the normal LAN port (for data transfer), and one to the Dedicated IPMI (LAN) port - which stays awake even when the machine is powered off, and deals with IPMI commands.
I think the command is:
ipmitool -I lanplus -H <IP-Address> -U <Username> -P <Password> power on
Shutdown is simple. Create a cron job that executes/sbin/shutdown -p now
at the desired time.
But how do you expect TrueNAS to wake up a system when TrueNAS is not running because the system is switched off?
You have in my experience two alternatives:
1. Wake on LAN
This needs to be supported by the hardware and you need a separate system to send a WoL packet to your TrueNAS. Very dependent on manufacture/mainboard/etc.
2. Clocked power switch
Most systems have an option in the BIOS that defines how the system should react after a power loss. With options "off", "on" and "last state". You could set that to "on" and use a timer to switch off the power, say, half an hour after your clean shutdown via cron job (see above), then restore power at the desired wake up time.
HTH,
Patrick
Could it be one of following, ie have you verified that
- the machines can reach each other across subnets?
- the IPMI command works as expected when sent by a machine on the local subnet?
logs might help you understand if commands are received but nothing happens.