Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have to write a script for a CentOS server which will kill and restart a process every three days. After killing the process it needs to execute another script and start the killed process.

Unfortunately after two or three days this process stops working, perhaps related to a memory issue.

Any ideas?

share|improve this question
What is the question? Can not find any question mark in your text. – ceving Jun 3 '11 at 19:20
up vote 0 down vote accepted

This question is confusing - do you want a script because you have to restart the process because it stops working after 2-3 days? And do you want to know why the process stops working? If so, it depends entirely on the process; what is the actual process? Nobody can tell you why a program stops working if they don't know what the program is!

If you just want an idea for a script, try this:

kill -9 $pidfile
$program &
echo $! > $pidfile

and run it on a crontab of every three days:

0     0     1/3     *     *         /your/script

This isn't tested so please excuse the odd error, but you should see the general idea.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.