Is there a bash command to check to see if Time Machine has finished backing up?
tmutil status is the Lion way now that we have a nice tool for this sort of query.

On newer OS, there is an undocumented command tmutil currentphase that shows the name of the current phase.