Scheduling Shutdown Automatically In Linux
Shutdown automatically in Linux server is very easy task. You can set shutdown operation at any time as per your requirement. It is very helpful task while running any process in the system that could be finished during night time.
In this article I will show you how you can set shutdown Linux server automatically.
Follow the below command to shutdown the system at 16:00, set time in 24hr format.
# shutdown 16:00
Cancel Scheduled Shutdown Task
Follow the below command to cancel the scheduled shutdown task.
# shutdown -c Broadcast message from [email protected] (Mon 2017-03-16 23:24:16 MSK): The system shutdown has been cancelled at Mon 2016-01-18 23:25:16 MSK!
You can also set cronjob to shutdown the system automatically.
# crontab -e 0 16 * * * /sbin/shutdown
Restart Crond Service
Now restart the crond service.
# /etc/init.d/crond restart
I hope this article will help to shutdown Linux server automatically. If you have any queries and problem please comment in comment section.