Auto / Scheduled shutdown

  • Hi, so I have a Intel nuc that is used for more than 1 thing...

    By default it boots into an Ubuntu install that's for Usenet etc..

    I use LibreElec on same nuc under a different partition...

    It auto powers on every day via a rtc wake alarm in the morning (thus ready for Usenet at any time)

    If I use LibreElec I don't wanna mess around with custom shutdown every time, is it possible to either via add-on or running a script have LibreElec auto shutdown daily at a set time?
    (in case I forget.. As it needs to be in a off state for the rtc Alarm to wake it...[WHITE SMILING FACE])

    Thanks.

    Sent from my HTC 10 using Tapatalk

    Edited once, last by DJ 1 (November 3, 2016 at 7:38 PM).

  • Using python

    /storage/.kodi/userdata/autoexec.py

    note that hour and minute aren't padded and are in 24 hour time
    so if you want 1am you would have
    HOUR = 1
    MINUTE = 0

    or if you want 4:30PM you would have
    HOUR = 16
    MINUTE = 30

    might have to set exec bit also

    Code
    chmod +x /storage/.kodi/userdata/autoexec.py

  • Ok..i just tried it and works nicely. I read before that if poweroff during streaming etc that its important to do a proper shutdown as to not corrupt anything?..
    Is this good enough as a 'clean shutdown'?

    Cheers.

    Sent from my HTC 10 using Tapatalk

  • Hello, I used the code to turn off the Kodi ... and it works well, congratulations.

    Now I would like to know if it is possible to do the same thing but in power up.

    I ask because it seems to me that the raspberry does not turn off completely.

    Thank you.