This will cause the shutdowns to be announced every half hour and performed at 5 minutes and 35 minutes past the hour. The command will always run on the half-hour mark, if the machine is up and running at that time. Otherwise, shutdown (under command) will have to be invoked as /sbin/shutdown. Make sure /sbin is in the PATH variable specified near the top of /etc/crontab.(Similarly, if it were every 20 minutes, you could write */20 or 0,20,40.) 0,30 under minute will also work, if you prefer that.Change +5 to something else to change how long users have after being warned of reboots.It runs every at every half hour mark ( */30). This will schedule the system to go down for reboot ( -r) five minutes after ( +5) the command runs. ![]() I've included it for clarity-something like it is there already. You don't actually have to add the fist line, which is a comment. To schedule a shutdown every half hour with a warning 5 minutes before, add this to /etc/crontab: #minute hour mday month wday user command ![]() Therefore, rather than scheduling the reboot command, I recommend scheduling the shutdown command so it warns the user. ![]() Rebooting every 30 minutes, and warning users before each reboot:Īssuming people might be using the machine, either locally or remotely, it's best to avoid restarting Ubuntu from under them without any warning. So I recommend editing your question to explain why you wish to do this. The best way to do this will depend on why you want Ubuntu to restart every half hour.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |