On 2020-12-24 10:31:22, Ian Darwin <i...@darwinsys.com> wrote:
> On Thu, Dec 24, 2020 at 11:51:26AM +0100, Gabriel Hondet wrote:
> > Hi,
> > 
> > How can I program my computer to automatically wake from suspend to ram
> > or suspend to disk at a certain time?
> > 
> > My goal is to suspend a server every day from, say, 11 pm to 7am.
> 
> For suspending at night, use see the cron man page.
> 
> For waking up in the morning, of course, the OS isn't running so there is 
> nothing
> it can do. Some but not all PC BIOSes have a scheduling feature. Otherwise a
> $10 mechanical timer to cut the power (well after the suspend is finished!) 
> and
> turn it back on in the morning.
> 

If shutting down the server entirely (instead of suspending it)
were an option, you could schedule a cron job to shut it down at a
given time and send a WoL (Wake on LAN) packet from another
computer on the network to wake it up again.

Oh, I just skimmed the ifconfig manpage and found the following:

        wol     Enable Wake on LAN (WoL).  When enabled, reception of a 
                WoL frame will cause the network card to power up the
                system from standby or suspend mode.  WoL frames are sent
                using arp(8).

So it looks like you could even do this while the system were
suspended if your network card supports it.  Of course, this
depends on having another server on the same, physical LAN as the
server in question, so the mechanical switch suggestion above might be
the only option if that's not the case.

-- 
Bryan

Reply via email to