[RESOLVED] @reboot doesn't seem to work in cron



  • I put a @reboot <my script> in the cron (using crontab -e). But my python script doesn't seem to launch on reboot. It runs fine if I run it from the command line.

    Is @reboot not supported in cron on the Omega?

    Thanks,
    Dave



  • As per stated here, OpenWRT/busybox(which onion is based on) does not support "@" expressions.

    I almost forgot to mention: you can provide a better behaviour(considering you'll have additional options) using init scripts. You can setup one using the instructions provided here. I have done one last weekend to start my python app with little/no headaches. I suggest give it a try.

    Regards,
    Vinicius



  • To run things on startup put the commands in the file /etc/rc.local before the exit 0 line ?
    I've done this for a couple of networking scripts I want to run on startup.



  • Thanks all! I put a line in /etc/rc.local and it worked!


  • administrators

    @Dave-Abouav glad to hear that!
    Can you please add [RESOLVED] to the post title?



  • FYI, if you want to start a process to run on startup and continue running, then you can add it to /etc/rc.local, but that'll keep rc.local running until your process finishes (never, possibly)

    Instead, you can use start-stop-daemon:

    start-stop-daemon -S -b -x /root/project/project-script
    

    You'll need to make sure your script is executable, too. The -b puts the process in the background so it won't hold up execution of the rest of rc.local.


Log in to reply
 

Looks like your connection to Onion Community was lost, please wait while we try to reconnect.