I'm not familiar with cron at all, and I've looked it up and am still confused as to how specifically it works. I'm on CentOS 6.5, and I need to end a process and then start it again every 12 hours. It will have a different pid every time though, so I'm not sure how I would kill the process. Then I need to restart the process. I would like for this to happen at 7am and 7pm every day.
How would I go about accomplishing this?
EDIT: I need to do this because we're running crtmpserver and it seems to quit after 15 hours or so. If it's restarted it bypasses this problem. Instead of figuring out the root problem I'd rather implement this since it should be a quick fix.
pkill
. Or alternatively you could write a script that launches the process and kills it after 12 hours.pkill
. The command I use (and the command that shows up inps aux
) is<command> <argument>
, would I need to justpkill
<command>
or the full string? Also, how would I accomplish it via cron?pkill <command>
, and it appeared to succeed but the process is still running.pkill <command> <argument>
returns a syntax error for thepkill
command.