http://unix.stackexchange.com/questions/25639/how-to-automat...
I have been wondering about doing something like this as well