Closed clemone210 closed 4 years ago
I worked it out.
I created a bash script in my root directory called startup.sh First I have to activate the virtualenv and afterwards run the python script to run DashMachine. so my startup.sh file looks like this:
#!/bin/bash
cd /etc
cd DashMachineEnv
source bin/activate
cd /etc
cd DashMachineEnv
cd DashMachine
python3 run.py
I made it executable using: chmod 755 startup.sh
running the command bash /startup.sh
brings up DashMachine when startet manually.
To autostart it at boot I used crontab.
crontab -e
Added following line at the bottom:
@reboot sudo /bin/bash /startup.sh 1> /home/timo/log.txt 2> /home/timo/err.txt &
1> /home/timo/log.txt 2> /home/timo/err.txt
is not neccessary, its just to check if there is an error.
Hello,
I setup everything well on Ubuntu 18.04.04 LTS with your python installation instructions. I want to setup the script with boot.
So after a reboot the script will not work anymore. If I run
python3 run.py
I get the following error:Could you help me out?