What's new

WOL by time

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Hello everyone, please tell me how to turn on the server by time. must be turned on every day at 8:00
What server?

Depending on what you are up to you may be better off using a software timer running on the server to shut it down and a supply device that on sensing the current drop below a certain level (the device having shut down) then shuts the power off. Then have that power device turn back on using a timer, with your server set to boot when it detects a power restore!
This is all complicated by the power drain of the device - can be expensive and may need to be custom. Also turning a server on and off in such a manner may well shorten its expected life and be less than 100% successful!

Or it could be as simple as running a cron job!

*Hence we really need a little more information!
 
What server?

Depending on what you are up to you may be better off using a software timer running on the server to shut it down and a supply device that on sensing the current drop below a certain level (the device having shut down) then shuts the power off. Then have that power device turn back on using a timer, with your server set to boot when it detects a power restore!
This is all complicated by the power drain of the device - can be expensive and may need to be custom. Also turning a server on and off in such a manner may well shorten its expected life and be less than 100% successful!

Or it could be as simple as running a cron job!

*Hence we really need a little more information!
the shutdown timer runs on the server and is set to 23:00. which runs on TrueNAS Scale. I would like the router to send a Magic Packet to it to turn it on every day at 8:00 in the morning
 
Does the server's BIOS have that option?

That's what would be most reliable.

And, what kind of server is this that is turned off daily?
 
Does the server's BIOS have that option?

That's what would be most reliable.

And, what kind of server is this that is turned off daily?
there is such an opportunity, but in order to enter the BIOS you need a display) and it is not at hand there)
 
So do a little script that runs as a chron job at 8am.

Code:
#!/bin/sh
/usr/sbin/ether-wake -i br0 -b "MA.CA.AD.DR.ESS"
logger "Server woken by WOL"

Usually WOL is also a BIOS option too. Remember, too, that you can't power off the server--it needs to be in a sleep state where WOL is active. The Core uses the -p (power off) option, not sure about Scale. If WOL won't work, the BIOS command is better, or set the power restored function to boot and use a wifi power switch.

This is a really bad idea, by the way. You would often want your scrubs, replication, snapshots, cloudsync, and other housekeeping to be running off hours. But it also sounds like you aren't using server-grade hardware, either (no IPMI). My TrueNAS server idles around 25 watts with 4 drives, so doing this would save me around 5 cents a day.

More thoughts here: https://www.truenas.com/community/threads/automatically-turn-on-and-shutdown.95459/. You can also add a wall message to the shutdown -p command: "Spinning down the infinite improbability drive now. All your work will be lost. There's no point in acting surprised.":)
 
Last edited:
as said by @elorimer , the way to go is via a cron job. To start it every tuesday at 08:00 it should look like:
00 08 * * 2 /jffs/scripts/wake-up-my-server.sh

This file has to contain the ether-wake command.

Also note that ARP table must have a permanent entry for your server:


Code:
arp -s ipaddr macaddr
and your server must of course be defined as static ip
 
You are putting unnecessary wear and strain on the server components if you're shutting down and turning it on daily.

You have many options above, but like @elorimer also hinted at; doing this via the BIOS is the preferred method (borrow a monitor for 10 minutes and do it).

Better yet, let the server run indefinitely. That is how it was designed to run.
 
as said by @elorimer , the way to go is via a cron job. To start it every tuesday at 08:00 it should look like:
00 08 * * 2 /jffs/scripts/wake-up-my-server.sh

This file has to contain the ether-wake command.

Also note that ARP table must have a permanent entry for your server:


Code:
arp -s ipaddr macaddr
and your server must of course be defined as static ip
I think if you broadcast it to the subnet you don't need either, yes?
 
I have to agree that continually starting and stopping the server on a daily basis is NOT a good idea.

In my experience, what kills hardware faster than anything else is the repeated spin-up/spin-down of hard drives and the change in temps. But if I keep things nice and steady (and that includes using a UPS), and cool, things just seems to run a LOT smoother for much, much longer. I have HDD drives now that are over a decade old.

Of course, there is a cost involved. But there's a cost w/ premature failure as well. But I'd rather deal w/ the cost up front and avoid the premature failure.

BTW, when I do need/want WOL, I prefer (where possible) to use the @elorimer approach of using wifi-enabled AC power plugs. Far more flexible in many cases. And they can be had pretty cheap, esp. when they go on sale (Amazon Prime had some the other day for $3 and change).
 
I think if you broadcast it to the subnet you don't need either, yes?
I do not know for sure. I have several devices configured to accept WOL ; I took the way to send magic packet specifically to one device at a time.
If you broadcast to the subnet, don't you think it will wake-up ALL devices that accepts WOL ? ...
 
I do not know for sure. I have several devices configured to accept WOL ; I took the way to send magic packet specifically to one device at a time.
If you broadcast to the subnet, don't you think it will wake-up ALL devices that accepts WOL ? ...
Only if the MAC matches.
 

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top