Centos7 crontab does not execute?

the server bought has less memory and occasionally ends the process automatically, so I plan to restart the system every Monday morning

0 21 * * 0 /sbin/shutdown -r now
0 21 * * 0 /sbin/reboot

neither of these is executed. What should I do?

look at the solutions on the Internet that have no effect.
crontab is activated and executed with root permissions

Apr.20,2021

first of all, you can take a look at the scheduled task log

/var/spool/cron  rootroot

secondly, you can increase the execution log, and you can view the execution error message

.
0 21 * * 0 /sbin/shutdown -r now  >>/cron.log 2>&1crontab

you first use crontab-l to see if there are scheduled tasks under the current root user .

if not, it is recommended to add scheduled tasks again after crontab-u root-e .

Menu