The Palos Publishing Company

Follow Us On The X Platform @PalosPublishing
Categories We Write About

Schedule automatic system restarts

To schedule automatic system restarts, the steps depend on the operating system you’re using. Here’s how to do it on Windows and Linux:


Windows (Using Task Scheduler)

  1. Open Task Scheduler:

    • Press Win + R, type taskschd.msc, and hit Enter.

  2. Create a New Task:

    • Click Create Basic Task on the right pane.

    • Name it (e.g., “Automatic Restart”) and click Next.

  3. Set the Trigger:

    • Choose how often you want the restart (Daily, Weekly, etc.), then set the time.

  4. Set the Action:

    • Select Start a program.

    • In the Program/script field, type:

      arduino
      shutdown
    • In the Add arguments field, type:

      bash
      /r /f /t 0
    • Click Next, then Finish.


Linux (Using cron)

  1. Open Terminal and edit the crontab:

    bash
    crontab -e
  2. Add a cron job (example: restart daily at 2 AM):

    bash
    0 2 * * * /sbin/shutdown -r now
    • You may need sudo privileges.

    • Ensure the full path to shutdown is used (check with which shutdown).


Notes:

  • /r: Restart (Windows)

  • /f: Force close applications (Windows)

  • /t 0: Time delay of 0 seconds (Windows)

  • On Linux, use /sbin/shutdown or /usr/sbin/shutdown depending on your distro.

Would you like to include conditions, such as restarting only if no users are logged in or during idle time?

Share this Page your favorite way: Click any app below to share.

Enter your email below to join The Palos Publishing Company Email List

We respect your email privacy

Categories We Write About