Just stumbled across this movable type Perl plugin that allows Perl code to be placed and executed in templates during rebuilds. Now THIS is something that could come in handy.
Perl plugin for movable type
Previous post: Rsync’ing through an SSH tunnel
Next post: sudo timeout duration