How do I get a script to run after start up in LibreElec?

  • I am using the same box to water the garden and I need to do a check after start up.

    How do I get a script to run after start up?

    I can start the script at a particular time eg 3:20 pm but I can not work out how to start it after boot up.

    I have edited crontab and used the @boot command

    crontab -e

    @reboot /path-to-script/script (or command)

    20 15 * * * /storage/Daves-script/script

    The script does not run at reboot but does at 3:20 pm

    Any help would be welcomed

    Dave

  • Code
    @reboot /usr/bin/bash /storage/path/to/script

    ^ see if adding the path to bash helps, and do the the same for the second line in crontab

  • Thanks for your help

    chewitt adding /usr/bin/bash didn't help

    ghtester your idea sent me in the right direction

    did some research on /storage/.config/autostart.sh

    to get

    (

    sleep 60;

    /storage/Daves-script/script

    )&

    note : must have " & "

    Thanks again

    Edited once, last by spotless (February 8, 2021 at 11:55 AM).