How to automatically wake up and shut down Linux, wake up and shut down Linux

Source: Internet
Author: User

How to automatically wake up and shut down Linux, wake up and shut down Linux

1. System sleep (crontab)

Example (create a root scheduled task to shut down at every night ):

1 # crontab-e-u root2 # m h dom mon dow command3 15 23 ***/sbin/shutdown-h now

Example (run from Monday to Friday only)

1 15 23 ** 1-5/sbin/shutdown-h now

In addition, you can directly add the scheduled service to the/etc/crontab file.

15 23 ** 1-5 root shutdown-h now

Ii. Wake-On-LAN)

1. Check whether Wake-On-LAN is enabled directly. The required function is g.

# Ethtool eth0 | grep-I wake-on Supports Wake-on: pumbg Wake-on: g

2. Start g (ps: This command may expire after restart)

# Ethtool-s eth0 wol g

3. Add cron To ensure that g is enabled after each restart

@ Reboot/usr/bin/ethtool-s eth0 wol g

 

Link: http://mp.weixin.qq.com/s/UhRWq8bYXrpw20LonlnbtQ

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.