I guess it depends and how and why it is failing. Can you not simply handle it in a try/except within the code?Hey y'all how would you get a Python script to restart itself in 30 seconds? I don't need it to be a cron job, just if it fails to do something then wait 30 seconds and re-run the script.
Glad you got it resolved. Not sure what your implementation is like; however if you're having issues with connections timing it out put them in separate threads/processes using either threading or multiprocessing modules.I just realized I can't do what I was trying to do... for other reasons. Basically if I can't connect to the internet the script kills itself as is and I need it not to do that. But this problem is fixed.
Thanks for your help!
This script basically emails me the ip address of my raspberry pi every time it reboots. It's so I can plug it in while I am out and ssh into it. It has it's own 4g dongle for internet.Glad you got it resolved. Not sure what your implementation is like; however if you're having issues with connections timing it out put them in separate threads/processes using either threading or multiprocessing modules.
If you've still got problems, happy to look at the code or knock something up myself. Just let me know!This script basically emails me the ip address of my raspberry pi every time it reboots. It's so I can plug it in while I am out and ssh into it. It has it's own 4g dongle for internet.
Why not just use an existing dynamic dns service?This script basically emails me the ip address of my raspberry pi every time it reboots. It's so I can plug it in while I am out and ssh into it. It has it's own 4g dongle for internet.