Growl when a process ends

Situation: you started a long-running process and you want Growl to notify you when it’s done.

Solution: glue together ps, grep, and growlnotify with a little command-line magic. In your terminal, type or paste the following, substituting in the process’s actual name:

while [ 1 ] ; do
  if [ "$(ps aux | grep <name of process> | grep -v grep)" = "" ]; then
    growlnotify -m "Long-running process complete" --sticky -p2
    break
  fi
  sleep 3
done

The growlnotify options ensure that it’s sticky and shown at a priority of “emergency”, which I have Growl display as bright red.

A simple, one-job PHP/cron dispatcher

Goal: To provide a way for a website administrator to dispatch a long-running command-line program, one that might take hours to complete (so exec is out). The admin interface should show that the process is running. There is only one job that will ever be dispatched.
Read More