How To Set Schedule automatic startup (and shutdown) System in Linux
# man rtcwake
[email protected]:~# apt-get install rtcwake
‘rtcwake’ package successfully Install…
Step- 3 How To Use..
Now use the basic syntax of the command..
[email protected]:~# rtcwake -m [type of suspend] -s [number of seconds]
(Note– First Check & Set The System Hardware Time..)
[email protected]:~# rtcwake -m disk -s 60
[email protected]:~# rtcwake -m no -l -t $(date +%s -d “tomorrow 09:30”)
Example-3. Keep on working right now, but once I hibernate at my will. Start the machine again at 6:30PM (OR 18:30PM) Today.
[email protected]:~# rtcwake -m no -l -t $(date +%s -d “today 06:30”)
Types of Suspend
- standby – Standby offers little power savings, but restoring to a running system is very quick. This is the default mode if you omit the -m switch.
- mem – Suspend to RAM. This offers significant power savings – everything is put into a low-power state, except your RAM. The contents of your memory are preserved.
- disk – Suspend to disk. The contents of your memory are written to disk and your computer is powered off. The computer will turn on and its state will be restored when the timer completes.
- off – Turn the computer off completely. rtcwake’s man page notes that restoring from “off” isn’t officially supported by the ACPI specification, but this works with many computers anyway.
- no – Don’t suspend the computer immediately, just set the wakeup time. For example, you could tell your computer to wake up at 6am. After that, can put it to sleep manually at 11pm or 1am – either way, it will wake up at 6am.
Seconds vs. Specific Time
Upon hibernation, the computer saves the contents of its random access memory (RAM) to a hard disk or other non-volatile storage. Upon resumption, the computer is exactly as it was upon entering hibernation.
Example- If You want to set, System automacialy go to hibernate mode after 1 minuts Now..
[email protected]:~# echo ‘pm-hibernate’ | at now + 01 minutes
# vim wake.sh
#To have your computer wake up at 1:30pm today and suspend after 2 Minutes.
rtcwake -m no -l -t $(date +%s -d “today 13:30”)
echo ‘pm-hibernate’ | at now + 02 minutes;exit
# chmod + x wake.sh
Now Your System Power off after 2 Minutes, and System on Automaticaly at 1:30PM…..