restart program every x minutes?
--------------------------------------------------
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Light Drops
--
Chapters
00:00 Restart Program Every X Minutes?
00:26 Accepted Answer Score 13
00:51 Answer 2 Score 2
01:11 Thank you
--
Full question
https://superuser.com/questions/506289/r...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #debian
#avk47
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Light Drops
--
Chapters
00:00 Restart Program Every X Minutes?
00:26 Accepted Answer Score 13
00:51 Answer 2 Score 2
01:11 Thank you
--
Full question
https://superuser.com/questions/506289/r...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#linux #debian
#avk47
ACCEPTED ANSWER
Score 13
You can try doing in your crontab
:
crontab -e
then
11 */3 * * * /usr/bin/pkill -f appli_name; /path/to/appli_name & &>/dev/null
The crontab
command mean :
- every 3 hours
- kill appli_name
- start appli_name in background
ANSWER 2
Score 2
I suggest you to configure Supervisor for your task. It can monitor the process, restart if it fails, also provides output redirection and other nice features. See the example for program to get started.