Article 5F116 How to automatically shutdown my computer

How to automatically shutdown my computer

by
Marqui
from LinuxQuestions.org on (#5F116)
Hello all,

i'm new to this forum; i used linux arch (EndeavourOS) on my personnal computer and MX-linux at school and i'm stuck with the following problem : i don't know how to use the "shutdown" command.

What i intend to do : I manage a classroom of 25 computers under linux MX (Debian) and I would like these computers to shut down automatically from Monday to Friday at 5:15pm. But for some reason i'cant do it.

I've read a lot of tutorials, but I can't figure out how to use the "shutdown" command with crontab. I went on the EndeavourOS and MX forums, without success.

What i've tried on my Arch computer (assuming that what works for Arch Linux also works for MX Linux) :

1)
[...@HPG4 ~]$ crontab -e

A window opens, but it is impossible to modify it...

so,

2)
[...@HPG4 ~]$ su -
Password:
[root@HPG4 ~]# cd /etc/cron.daily
[root@HPG4 cron.daily]# touch shutdown
root@HPG4 cron.daily]# ls
shutdown
[root@HPG4 cron.daily]# nano shutdown

GNU nano 5.4 shutdown
15 17 * * * shutdown

[root@HPG4 cron.daily]# crontab -l
no crontab for root
(?????) Did i miss something ????

[root@HPG4 cron.daily]#
ctrl+d
logout
[...@HPG4 ~]$ systemctl enable cronie
[...@HPG4 ~]$ crontab -l
43 17 * * * shutdown

But nothing happens at 5:15 p.m. (???).

3) [...@HPG4 ~]$locate kcron
/timeshift/snapshots/2020-10-17_10-15-25/localhost/usr/share/doc/HTML/ca/kcontrol5/kcron

etc...

It seems that kcron is well installed on my system, but impossible to find it in graphic mode.

[...@HPG4 ~]$ man kcron
No manual entry for kcron
...
bash: kcron: command not found

Of course, I went on multiple forums, without success.

Here is my n1 question:

What is the easiest way to shutdown every day at specific time the computers of my class room ?

Alternatively :

What did I do wrong with crontab?

Why can't I access kcron in graphical mode on my Arch computer ?

So, thank you in advance, for anyone who take time to read me, i really appreciate your help.

Marclatest?d=yIl2AUoC8zA latest?i=W7_Ryn17um8:65CjhmUZquc:F7zBnMy latest?i=W7_Ryn17um8:65CjhmUZquc:V_sGLiP latest?d=qj6IDK7rITs latest?i=W7_Ryn17um8:65CjhmUZquc:gIN9vFwW7_Ryn17um8
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments