Crontab Reboot on CentOS 7
Crontab Reboot on CentOS 7
Hello guys.
I'm trying to Schedule an automatic reboot for my CentOS Server everyday at the 08:30 (a.m).
I put (with crontab -e) this command:
30 8 * * * root reboot
But is not working.
I tried this command aswell:
30 8 * * * root shutdown -r now
Can you help me out, please?
Thank you.
I'm trying to Schedule an automatic reboot for my CentOS Server everyday at the 08:30 (a.m).
I put (with crontab -e) this command:
30 8 * * * root reboot
But is not working.
I tried this command aswell:
30 8 * * * root shutdown -r now
Can you help me out, please?
Thank you.
Re: Crontab Reboot on CentOS 7
Hi,
Have you inspected the cron log file and see what happening that may become the root cause of the problem?
Have you successfully executed other cron command?
Have you inspected the cron log file and see what happening that may become the root cause of the problem?
Have you successfully executed other cron command?
Re: Crontab Reboot on CentOS 7
See crontab man pages for valid syntax and examples:
Also, errors should be emailed to you by crond. Type
in a terminal and press Return to read the mail (q to quit).
Code: Select all
man crontab
man 5 crontab
Code: Select all
mail
Root is evil: Do not use root (sudo) to run any of the commands specified in my posts unless explicitly indicated. Please, provide the necessary amount of context to understand your problem/question.
-
- Posts: 58
- Joined: 2015/04/11 04:59:25
- Location: United Kingdom
Re: Crontab Reboot on CentOS 7
Hi,
Which control panel are you using?
Which control panel are you using?
Re: Crontab Reboot on CentOS 7
Why would you do this anyway?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke
Re: Crontab Reboot on CentOS 7
Probably wants the full path (so something like /sbin/reboot).
But yeah, don't do that....
But yeah, don't do that....
-
- Posts: 70
- Joined: 2012/06/27 07:55:01
Re: Crontab Reboot on CentOS 7
I am not sure that crontab can wake machines up. but you can try other ways. Such as
-you can wake a machine With a Magic packet
-you can set system with SRTC alarm to wake on the time.
-Most of machines have WOL option in BIOS you can set it to wake on scheduled time.
However you can shutdown your machine with crontab
let suppose you want to shutdown your machine at 5:30PM see the line below
30 17 * * * /sbin/shutdown -h now
save the crontab file and exit .
-you can wake a machine With a Magic packet
-you can set system with SRTC alarm to wake on the time.
-Most of machines have WOL option in BIOS you can set it to wake on scheduled time.
However you can shutdown your machine with crontab
let suppose you want to shutdown your machine at 5:30PM see the line below
30 17 * * * /sbin/shutdown -h now
save the crontab file and exit .