http://www.unix.com/shell-programming-and-scripting/223177-shell-script-logging-cpu-memory-usage-linux-process.html