Detailed explanation of the steps for automatic wake-up and shutdown of Linux computers

Don't be a waste of electricity. If your computer does not need to be turned on, please turn them off. For convenience and computer home considerations, you can configure automatic wake-up and shutdown by configuring your Linux computer.

Valuable system uptime

Sometimes some computers need to be powered on all the time, and this is allowed without exceeding the computer's running time limit. Some people are proud that their computers can function for long periods of time, and now we have a kernel hot fix that requires a machine shutdown only in the event of a hardware failure. I think it's more practical to save energy like reducing wear on moving parts and shut it down without the need for the machine to run. For example, you can wake up the backup server within the specified time, perform a backup, and then close it until it is ready for the next backup. Alternatively, you can set your internet gateway to run only at specific times. Anything that doesn't need to be running all the time can be configured to open when it needs to work, and turn it off when it's done.

System sleep

For computers that don't need to be running all the time, you can reliably shut down your computer using root's cron scheduled task (ie /etc/crontab). This example creates a root scheduled task that is scheduled to shut down at 11:15 every night.

# crontab -e -u root

# mh dom mon dow command

1523 * * * /sbin/shutdown -hnow

The following example runs only from Monday to Friday:

1523 * * 1-5 /sbin/shutdown -hnow

You can create multiple cron jobs for different dates and times. The fields of all time and date can be found by the command man 5 crontab.

A quick and easy way is to use the /etc/crontab file. But then you have to specify the user:

1523 * * 1-5root shutdown -hnow

Automatic wake up

Achieving automatic wakeups is a cool thing; most of my SUSE (SUSE Linux) colleagues are in Nuremberg, so I have to get up at 5 am in order to work with my colleagues for hours. My computer starts working automatically at 5:30 in the morning, and I just need to drag myself and coffee onto my desk to get started. Pressing the power button doesn't seem like a big deal, but every little thing gets big at that time of the day.

Wakeping up a Linux computer may not be as reliable as turning it off, so you may need to try a different approach. You can use Wake-On-LAN, RTC wake-up, or PC BIOS settings to wake up these ways. The reason these methods work is that when you turn off the computer, this does not really shut down the computer; the computer is in a very low power state and can accept and respond to signals. It only turns off completely when you unplug the power switch.

BIOS wake up

BIOS wakeup is the most reliable. My system motherboard BIOS has an easy to use wakeup scheduler (Figure 1). It's just as easy for you.

Figure 1: My system BIOS has an easy-to-use wake-up timer.

Host remote wakeup (Wake-On-LAN)

Remote wakeup is another reliable wakeup method that is second only to BIOS wakeup. This requires you to send a signal from the second computer to the computer you want to open. You can use the Arduino or Raspberry Pi Raspberry Pi to send a wake-up signal to a Linux-based router or any Linux computer. First, check to see if the system board BIOS supports Wake-On-LAN. If it is supported, it must be started first because it is disabled by default.

Then, you need a network card that supports Wake-On-LAN; the wireless network card does not support it. You need to run the ethtool command to see if the NIC supports Wake-On-LAN:

# ethtool eth0 | grep -i wake-on

Supports Wake-on: pumbg

Wake-on: g

The "Supports Wake-on" field output by this command will tell you which features your network card is currently enabled:

d — disabled

p — wake up physical activity

u — unicast message wake up

m — multicast (multicast) message wake up

b — wake up the broadcast message

a — ARP wake up

g — specific packet magic packet wake up

s — a specific packet with a password, magic packet wakes up

The man manual for the ethtool command does not make sense for the p option; this indicates that any signal will cause wakeup. However, it did not do this in my tests. The function that must be supported to implement a remote wake-up host is g -- the specific packet magic packet wakes up, and the "Wake-on" line below shows that this feature is already enabled. If it is not enabled, you can enable it with the ethtool command.

# ethtool -s eth0 wol g

This command may fail after a reboot, so to ensure that nothing is wrong, you can create a root user's scheduled task (cron) to execute this command each time it is restarted.

@reboot /usr/bin/ethtool -seth0 wolg

Another option is that the recent Network Manager Network Manager version has a nice small checkbox to enable Wake-On-LAN (Figure 2).

Figure 2: Enabling Wake on LAN

There is a place to set a password, but if your network interface does not support Secure Boot Secure Password, it will not work.

Now you need to configure a second computer to send wake-up signals. You don't need root privileges, so you can create cron tasks for your regular users. What you need to use is the network interface and MAC address information of the machine you want to wake up.

3008 * * * /usr/bin/wakeonlan D0:50:99:82:E7:2B

Thermal Overload Relay

Thermal Overload Relays are protective devices used for overload protection of electric motors or other electrical equipment and electrical circuits,It consists of heating elements, bimetals,contacts and a set of transmission and adjustment mechanisms.

Our Thermal Overload Relays had been divided into five series(as follow),with good quality and most competitive price,had exported into global market for many years:

LR1-D New Thermal Relay
LR2-D Thermal Relay
LR-D New Thermal Relay
LR9-F Thermal Relay
Intermediate Relay

The working principle of the thermal relay is that the current flowing into the heating element generates heat, and the bimetal having different expansion coefficients is deformed. When the deformation reaches a certain distance, the link is pushed to break the control circuit, thereby making the contactor Loss of power, the main circuit is disconnected, to achieve overload protection of the motor.
As an overload protection component of the motor, the thermal relay has been widely used in production due to its small size, simple structure and low cost.

JR28-D13(LR2)111

Thermal Overload Relay,Telemecanique Overload Relay,Thermal Digital Overload Relay,Telemecanique Model Thermal Relay

Ningbo Bond Industrial Electric Co., Ltd. , https://www.bondelectro.com

This entry was posted in on