If you are running a headless ubuntu server as a media server that is on 24/7, you could be wasting several hours of energy - especially at night when no one is using it. To solve this problem, you can automatically shut it down and turn it on at certain time using
rtcwake
. See below for step by step:
- Login as root and open `crontab`.
$ sudo su
$ crontab -e
- Add the command to
crontab
.
# Shutdown at 12 AM and awake afer 8 hours (8:00 AM)
0 0 * * * sudo /usr/sbin/rtcwake -m disk -s 28800 > /var/log/crontab.log