System Status
Buy Now
  • Email & Apps
  • Office 365
Login
  • MyRackspace Portal
  • Cloud Control Panel
  • Rackspace Webmail Login
  • Cloud Office Control Panel
  • Support Home
  • How-To
  • Developer Documentation
  •  Blogs 
    • Expert Insights Tech Blog
    • Rackspace Blog
    • Solve: Thought Leadership

Support Network

End-to-End Multicloud Solutions.   Solving Together.™   Learn more at Rackspace.com

How–To Home

Cloud Servers

  • Introduction
  • FAQ
  • All Articles

Schedule reboots in the Ubuntu operating system

Last updated on:  2020-09-24

Authored by:  James Andrade


This article describes how to schedule reboots in the Ubuntu® operating system.

Schedule a reboot by using crontab

Suppose you want to reboot the server at 2:05 am every day. Perform the following steps, adjusting the details to fit your requirements:

  1. Use the following command to edit the crontab file:

    $ sudo crontab -e
    
  2. To enter insert mode and add a new line at the end of the file, move the cursor to the last line and press the letter o.

  3. In the blank line, add the following line to the file to set the desired daily execution time and command to execute:

    05 02   *   *   *    /sbin/shutdown -r +5
    
  4. Press Esc to exit insert mode and then enter :wq to save the file and quit crontab.

Crontab example:

The following example shows the possible values for each element of a line in crontab.

# Example of job definition:
# .---------------- minute (0 - 59)
# |  .------------- hour (0 - 23)
# |  |  .---------- day of month (1 - 31)
# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
# |  |  |  |  .---- day of week (0 - 6) (Sunday=0, Monday=1, and so on)
# |  |  |  |  |
# *  *  *  *  * user-name  command-to-be-executed

Note: Rebooting your server periodically might be a temporary fix. Troubleshoot the actual issue instead of relying on a server re-boot to mask the issue.

Share this information:

©2020 Rackspace US, Inc.

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License

See license specifics and DISCLAIMER

About Rackspace
  • About
  • Customer Stories
  • Events
  • Programs
Blogs
  • The Rackspace Blog
  • Expert Insights Tech Blog
  • Solve: Thought Leadership
  • News
  • Contact Information
  • Legal
  • Careers
Site Information
  • Style Guide for Technical Content
  • Trademarks
  • Privacy Statement
  • Website Terms
Support Network
  • Support Network Home
  • Rackspace How-To
  • API Documentation
  • Developer Center
  • ©2020 Rackspace US, Inc.