Bash Shell Scripting Cheat Sheet

Redirection

http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO-3.html

Log bash script output

Put this on top of your bash script: 

exec 1>/path/to/logfile 2>&1