Post
Topic
Board Bitcoin Discussion
Re: How to repeat the same command automatically in Linux?
by
Bitsky
on 04/03/2018, 09:29:58 UTC
Does your script create a pidfile in eg /var/run? If so, you can use a cronjob to see if the pid still exist ("kill -0 `cat /var/run/myprocess.pid`").
If there is no pidfile, you can use top to see if the process is still running ("pidof myprocess" or "ps -x | grep myprocess | grep -v grep | awk {'print $1'}")