How to schedule Linux to turn on automatically
You probably already know that you can bring your computer to Sleep mode to save a lot of power or battery on your laptop. A battery-powered device can be maintained for several days in standby mode because the amount of energy consumed in this state is extremely low.
Users can "wake up" the computer at any time by pressing the power button or any key on the keyboard. But what if you want it to automatically 'wake up' at a certain time? The cause of this may be that users want to automate certain tasks, such as downloading something at 4 am, when the Internet speed may be much higher than the times. another day. With a bit of 'magic' from the command line, users can now automatically turn on Linux computers, perform some tasks, and then "sleep" again.
Besides re-enabling from standby, it is more useful to turn off the computer completely and turn on the power at certain times. Hibernation is also supported, but Linux systems use proprietary drivers that often don't "wake up" from hibernation properly.
Install Linux to automatically turn on
- Check if the computer supports 'wake up' options
- How to use rtcwake command
- Rtwwake Date parameter
- rtcwake Dry Run
- Energy saving method with rtcwake
Check if the computer supports 'wake up' options
Most computers will support "wake up" options, but most computers may not have the right hardware to do this. You can perform a quick test by opening the terminal and entering the following command:
sudo rtcwake -m mem -s 30
The computer will enter Sleep mode and 'wake up' after 30 seconds. If you want your device to be in standby mode longer, increase the number 30 to a larger value.
Also, check to see if the computer supports the 'wake up' feature after completely shutdown.
sudo rtcwake -m off -s 60
Regarding the -m off parameter , the user guide usually refers to the content: ' Not officially supported by ACPI, but nó thường works '. (Not officially supported by ACPI, but usually works).
If the kernel, drivers and hardware are compatible, there will be no problem. If timers are not supported, it may be because the hardware and / or BIOS / UEFI configuration does not meet the requirements. You can also try upgrading some drivers or switching from proprietary drivers to open source drivers. Maybe they will solve the problem. Alternatively, try installing a new kernel.
As mentioned earlier, hibernation has problems not related to the rtcwake command . In most cases it will work well but sometimes there are times when it fails. When it fails, the screen will remain dark or display an error message.
How to use rtcwake command
The basic usage of the command is simple: Choose a method to save energy and the time the computer 'wakes up'. In the previous command, the -s parameter was used to specify the number of seconds before the computer turned on again. But usually, users will want to specify absolute time, such as 9 am tomorrow. To do that, use the --date parameter instead of -s.
Rtwwake Date parameter
sudo rtcwake -m mem --date 09:00
Note: Not all hardware supports setting the turn on time to the next day. Users will have to check if it works with their specific device.
Time is set in 24-hour format. The screenshot below uses the rtcwake command with different options to set the time and date for the machine to turn itself back on.
'YYYY-MM-DD hh: mm' : year, month, day, hour and minute. For example:
--date 2020-02-28 15:00
means 3 pm on February 28, 2020.
Test the rtcwake command
You can add another parameter to rtcwake, -n, to display the time to turn on the machine.
sudo rtcwake -m mem --date +12hours -n
This is a 'dry run' command, it is not really timed but just 'pretending' to do it. Adding the -n parameter is useful when you want to check if the parameter associated with the date is set correctly. Once you make sure that this parameter is correct, simply remove the -n parameter in the command to set the actual 'wake up' time.
Energy saving method with rtcwake
The options related to the -m parameter are:
- -m mem - Normal standby, which the user is familiar with in the Shutdown menu.
- -m disk - Hibernation mode, save the memory contents to the storage device. Not recommended when using proprietary drivers.
- -m off - Turn off the phone normally.
- -m disable - Remove the previously set timer.
- -m no - Do not enable or set the standby mode, just set the 'wake up' event. For example, you can set the time when the computer will "wake up" tomorrow, then continue working on your computer. When you're done, turn off the device normally and the device will automatically power on in the morning.
- -m show - Displays 'wake up' events (previously set alarms) currently active.
You can find creative ways to use the rtcwake command. In this way, users can skip the boring boot process (this may take more than a minute on some systems). You can also install a utility, such as at, to automate the tasks that the computer runs after waking up.
Good luck!
See more:
- Set the time to automatically shutdown in Ubuntu with EasyShutdown
- How to turn off the computer automatically
- Set the shutdown or hibernate time for the computer
You should read it
- Basic Linux commands everyone needs to know
- How to use the last command in Linux
- How to use the stat command on Linux
- 20+ essential Linux security commands
- How to use ss command on Linux
- 12 things Linux is easier to do in the command line than graphical software
- Instructions for using zforce command on Linux
- The Cat command in Linux
May be interested
- How to turn off the computer automaticallyautomatic computer shutdown timer allows you to schedule a computer shutdown on windows 10, windows 7/8 even without sitting in front of the computer. the way to turn off the computer below is quite easy to use on operating systems, please consult.
- How to schedule Facebook and Instagram posts automaticallyposting automatically on instagram helps users save post time, freely choose the time that they want to post.
- How to schedule Android phones to work automaticallyandroid users can set up their phones to work automatically by using the smart connect application, which has the main function of automatically performing a series of actions at the time you set. , or when you connect an external device to your android device.
- How to Enable Night Shift on a Macthis wikihow teaches you how to turn on night shift on your mac and schedule it to turn on and off every day at designated sunset and sunrise times. night shift automatically shifts your display to a warmer color temperature in order to...
- Shutdown command - Schedule the shutdown of Windows 10 with the Shutdown commandshutdown command - schedule the shutdown of windows 10 with the shutdown command. you are downloading or automatically processing something on your computer but you do not wait until it is finished to turn off the computer. so you want to find a way to shut down your computer using shutdow
- How to turn any Linux PC into HTPC without Kodibuntukodi is an excellent open source home theater system and, thanks to its wide availability, is the leading diy media center software.
- How to turn on Linux App Mode on Chromebookssurely, when talking about chromebooks, many people will come across one word: linux! chromebooks are evolving their ability to use linux. it all started to change.
- How to schedule a computer to turn off on Windows 10the following article details instructions how to turn off the computer on windows 10 - a very optimal feature for those who listen to music before going to bed.
- How to use Snapup to take screenshots automaticallythe snapup will schedule a screenshot of the webpage automatically according to the time we have set.
- 5 tools to help manage and schedulethere are many applications and websites that can help you keep up with everything in your schedule. here are 5 free tools that can be especially helpful to schedule your schedule in order.