I realize this is frowned upon. Many will suggest they don't recommend doing a server restart from cron because it's not being monitored. In my case I would like to do this, the reason is because the server is used for only one task, in a node server environment. The server runs out of memory and I've been advised to just restart the whole server. I'm ok with this.
Currently in my cron file I have the following. (I got this off another stack question) .
0 */4 * * * /usr/bin/reboot
However it doesn't work. When I manually go to this directory /usr/bin/
then type "reboot
" it works. But executing like this /usr/bin/reboot from chron doesn't restart the server.
When I do ls /usr/bin/reboot
the return is /usr/bin/reboot
When I do which reboot
the return is /sbin/reboot
How would I restart the server on centos 6 using cron?