T
T
Talyan2021-05-03 07:39:31
linux
Talyan, 2021-05-03 07:39:31

What is my mistake in Cron?

Hello.

I set up iptables on the server, and in order not to mess up and lose access, I added to the
crontab -e
line

#m h  dom mon dow   command
#Safemode
5 * * * * reboot


As a result, I configured the firewall, but today I looked into the cron - it turns out that I forgot to remove the task.

I looked uptime - and he never rebooted.

What have I done wrong? I ran the crontab -e command as root.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
alegzz, 2021-05-03
@flapflapjack

you need to either set the PATH variable in the crontab or write the full path:
/usb/sbin/reboot

B
BorLaze, 2021-05-03
@BorLaze

Look at your root mail - there should be messages if the cron wrote something.
You can also check /var/log/syslog.

V
Valdemar Smorman, 2021-05-03
@smorman

Maybe systemctl reboot
?
Well, and I hope that the user on the server is one root?

A
alegzz, 2021-05-03
@alegzz

you need to either set the PATH variable in the crontab or write the full path:
/usb/sbin/reboot

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question