I have programmed a discord bot for a community server and put all the files to my rasbery pi5 for 24/7 hosting.
I tried to figure out how to autostart specific scripts or apps and found out that crontab is mostly used expecially for not having the best experience in Linux. now i stumbled upon the problem that crontab is now executing python apps.
my entry in the /tmp/crontab.adOmV8/crontab folder:
@reboot python3 /home/pi/Desktop/architect-discord-bot/main.py &
i debugged it with:
@reboot echo "TEST" >> /tmp/test.txt
and that worked.
I thought about the internet connection with the pycord api so i put a time.sleep(10) on the beginning of my script so that the script need to wait for establishing the internet connection to my router.
My possible thoughts:
Crontab dont have the permission for exec. python apps.
does anyone have a good solution to make it work? :/
-
debugged with:
@reboot echo "TEST" >> /tmp/test.txt
-
reinstalled crontab
-
tried to run as a root:
sudo crontab -e
-
checked the entered paths
-
gave the execution permission for main.py file of my bot
-
tried it with the following path:
@reboot **/bin/python3** /home/pi.....
syg.xn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.