Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

So there is a process I see in my activity monitor and I can kill it. Due to whatever, another process is set to restart the killed process every 8 hours and it can not be changed. I am looking for a macro of sorts to have the killable process killed every 8 hours. Mmmm?

share|improve this question

Are you able to manually kill the process using the kill command in terminal?

I've setup the scheduler to kill user jobs that run out of control by noting the program name and the time it's been running and how much cpu it's eating up. I usually get that by running the 'ps' command and piping it to awk because it can do the if/then/elses needed to see if the process is truly the troublemaker and needs killing.

In your case, if it's always a single program that needs killing, you can simply schedule the following command every 8 hours via cron:

8 7,15,23 * * * killall "program-name-to-kill-here" >/dev/null 2>&1

Translation: at 8 minutes past 7am, 3pm and 11pm everyday kill the program between double-quotes" and send the feedback to nowhere...

You can read the man page for crontab from terminal using: man crontab

share|improve this answer
Every 8 hours would be 0 */8 * * * killall processname > /dev/null 2>&1. And if the process is owned by root, you can use sudo crontab -e. – user495470 Jan 31 '13 at 10:32
every 8 hours can be defined in both ways – tuananh Jan 31 '13 at 21:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .