l wrote a python script with while true to do task to catch email's attachment, but sometimes l found out it would exit unexpectedly on server.
l run it on my local for more than 4 hours with no problem, so l can confirm that the code is correct.
So is there a kind of mechanism to restart python when it exit unexpectedly, such as process monitoring? l am a novice in linux.
remark: l run this python script like python attachment.py & in a shell script.
while true; do python attachment.py; done &