On my raspberry pi device with ubuntu 20.04 , when I manually run the start.py code after reboot the device within the folder /home/okay
python3 start.py
both scripts are running one after the other. But when I put this code in @reboot in crontab,
@reboot sleep 300 && python3 /home/okay/start.py
only the first script runs, the second one does not.
the py script is below
import os
os.system ("python3 /home/okay/avadot.py & ")
os.system ("python3 /home/okay/main.py &")
The reason I wrote the code with os.system is that both py files run in a while True: loop every 10 minutes. Therefore, it is not possible to start the other when one is finished, both must start working at the same time.