• 6

A PHP Error was encountered

Severity: Notice

Message: Undefined index: userid

Filename: views/question.php

Line Number: 191


File: /home/prodcxja/public_html/questions/application/views/question.php
Line: 191
Function: _error_handler

File: /home/prodcxja/public_html/questions/application/controllers/Questions.php
Line: 433
Function: view

File: /home/prodcxja/public_html/questions/index.php
Line: 315
Function: require_once

name Punditsdkoslkdosdkoskdo

reboot ubuntu 14 server via cron

For whatever my reasons, I want to restart my Ubuntu server every 6 hours via cronjob. I added a cronjob in crontab -e being the following:

* */6 * * * root /sbin/shutdown -r now

however I just checked my uptime and it's 10+ hours.

Any ideas?

Full reboots are not recommended like this. I think you are already aware of this so here's an answer to your question.

I suspect that your problem is that the contrab -e command is designed for a user to add their own cron scripts. It's not generally used for adding system (root) cron entries.

I believe you would be better to manually add a file in /etc/crontab.d/ or even add an entry in /etc/crontab.

  • 3
Reply Report
      • 1
    • /etc/crontab might get overwritten on system upgrades, so a files in /etc/crontab.d is a better choice.

Warm tip !!!

This article is reproduced from Stack Exchange / Stack Overflow, please click

Trending Tags