skip to Main Content

I want to reboot my raspberry pi every day at 4 in the morning because it’s the perfect time to reboot because its guaranteed no one will connect to it, As I am hosting a local server on there and just to ensure that it doesn’t slow down or anything I want to reboot it.

I heard you can use crontab?

Would it look like this?
0 0, 4 * * * reboot ?
Or is this 4 at night?

I don’t understand how PM or AM works in this format or system.

2

Answers


  1. Cron uses the 24 hour clock. PM is hours between 12 and 23.

    4am every day would be:

    0 4 * * * reboot
    

    (without the extra 0, you’ve inserted in yours).

    Login or Signup to reply.
  2. This line will reboot it @4 am in the morning

    0 4 * * * reboot
    

    I prefer using https://crontab.guru/#00_00__ this will help you time your cron events.
    This is an excellent page to verify your cron time.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search