Technical information on this site may be out of date : no updates since 2015

Log output of a script to a file

July 12, 2012 , posted under bash

Nice bit of bash fu I discovered today

Add this snippet to the top of scripts and the output of lines below will be tee’d to a logfile.

Handy for those scripts you always want a log of

Read More…

verbose remote ssh (with echo)

January 20, 2012 , posted under linux bash ssh sysadmin

I usually manage website deployment with bash scripts that run remote commands on the servers

In order that I can see what is going on and debug any errors verbose output is useful.

Running “bash -ex” causes each line to be output as it progresses and halt on any error so that you don’t miss it.

within the remote command “set -x” cause bash to echo all commands

Read More…