You are not logged in.

#1 2026-06-13 05:15

radko
Member
Registered: 2026-04-21
Posts: 6

How to shut down system at specific time?

How to shut down system at specific time?

Offline

#2 2026-06-13 06:46

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 1,579

Re: How to shut down system at specific time?

One solution is to use cron
This web page explains it all very well https://www.centron.de/en/tutorial/linu … with-cron/
Go down to the section Advanced Scheduling of the Shutdown Command for the details you need but basically it is:-

$ sudo crontab -e 
no crontab for root - using an empty one

Select an editor.  To change later, run 'select-editor'.
  1. /bin/nano        <---- easiest
  2. /usr/bin/vim.basic
  3. /usr/bin/vim.tiny
  4. /bin/ed

Choose 1-4 [1]: 1 

Make a selection and continue.
Note: Using sudo to edit the crontab means the command will run as the root user.

Next, add the following line:

0 23 * * * /usr/sbin/shutdown -h +30 "The system will shutdown in 30 minutes." 

Save and exit the editor.

 Ctrl O to save then Ctrl X to exit 

This Cron Job schedules the system to power off every day at 23:30 with a 30 minute warning at 23:00. Adapt to the timings you require.

Offline

Board footer

Powered by FluxBB