Autorestart at special time

Hello,

I have a question. Is there a way (Addon) to restart my Kodi/Vero 4k everyday At 6 o clock in the morning?

Many Thanks

Shawn

You could do this using cron.

Sam

Hi,

Easiest way to do it would be a a cron job:

https://www.raspberrypi.org/documentation/linux/usage/cron.md

you will need to access the command line:

sudo crontab -e

* 6 * * * /bin/bash /sbin/reboot

* 6 * * * /sbin/reboot

Thanks Tom.

1 Like

Install cron from app-store first .

Not sure if thats required I’ve not installed cron in myosmc and yet its installed and the service is enabled. I’ve not done it manually, not had vero4k+ long

Logged in to the wrong vero, @joakim_s is indeed correct cron does need to be installed.

Why would one need to reboot OSMC daily? Is there any need for that? Is OSMC not supposed to run 24/7 “without a glitch” like other distros?

If it’s only to reduce the risk of Kodi misbehaving, one could set the following instead:

0 6 * * * /bin/systemctl restart mediacenter
3 Likes

Hi everyone.
If i enter

  • sudo crontab -e
    or
  • crontab -e

i get the error “crontab: command not found”.
How can i install crontab?

“sudo apt install crontab”?

Many Thanks for every help

Check this reply:

Where can i find the “App-Store”?

Many Thanks!

Shawn

In myosmc which is under program add-ons.

1 Like

Head to the console, and then:

$ sudo apt install cron

(this what I did yesterday)

Apparently, you don’t need to use sudo to restart the mediacenter. Only input crontab -e (then, hit enter) to add the above task.

crontab -l to list the tasks for user osmc.

(no need to use sudo with crontab)

Then that’s what I have to do if I understand it correctly, isn’t it?

  1. Connect to the command line SSH.
  2. Enter “Sudo apt install cron” or install it from App-Store und (myOSMC).
  3. Connect to the command line SSH and Enter “crontab -e”
  4. Add “0 6 * * * /bin/systemctl restart mediacenter”

if something works wrong. How can i delete my entry in the Crontab? Only delete the line?

Many Thanks

Shawn

Correct, just remove that line.

Yeah, connect via SSH, run sudo apt install cron, then crontab -e afterwards. Add 0 6 * * * /bin/systemctl restart mediacenter, then save and exit your editor. To revert back to default, crontab -e again, then suppress the entry, save and exit the editor.

After exiting the editor, you should read:

crontab: installing new crontab

One last question? How can i save the crontab after editing the line?

Exit will let me out of it.

Shawn

ctrl-x and yes to save.

1 Like

Many Thanks to everybody who helped me. I Think i have done it.

Is there any way to control that the crontab works fine? Log / command line / something else?

You should find a record in journalctl

1 Like

Wehre can i find the journalctl?

Many Thanks

Shawn

It’s a command.

journalctl --help

will show you the options.

1 Like