Send all output in a script to a file
#!/bin/bash # Put this at the top of your script exec >> /some/file.log exec 2>&1