tellmewhen

Tell me when another program has finshed. Show me when it started, when it finished and how long it took. Show me the output and if it errored.

I created this utility because I had long running database scripts that I wanted a completion notification for – including a summary of the time and exit code. I had done this various ways in the past by using bash and other shell utilities. This program captures all of the features and behavior I wanted without having to script it from scratch again every time I needed it.

  • YML Based Configuration in an rc file
  • easy default configuration
  • sends email
  • includes start/stop/elapsed timing
  • success/fail based on exit code
  • watch an already running process (by pid, by grep pattern over ‘ps aux’)
  • release as a gem so it’s easy to use/install

Configuration

Configuration Defaults:

Configuration is then merged from $HOME/.tellmewhenrc if the file exists in $HOME. Configuration is also merged from ./.tellmewhenrc in the current directory, if the file exists. This allows you some flexibility in overriding settings.

Usage

Usage: ./tellmewhen command args...
    -v, --[no-]verbose               Run Verbosely.
    -c, --config=file                Use alternate configuration file.
    -p, --pid=pid                    Wait for <pid> to terminate.
    -e, --exists=file                Wait for <file> to exist.
    -m, --modified=file              Wait for <file> to be modified.
    -t, --timeout=seconds            Wait for up to <seconds> seconds for the command before sendin a 'pending' notification.
    -w, --write-config=file          Write [fully merged] configuration to <file> (NB: will not be clobber).

Examples

   ./tellmewhen 'sleep 3; ls'
    ./tellmewhen -p 12345
    ./tellmewhen -e some-file.txt    # await existance
    ./tellmewhen -m some-file.txt    # await update

Authors

License

Patches Welcome

I’d like to clean up the internals: how emails are composed.

I’d like to support other notification channels, like Instant Messaging or SMS. Multiple at one time, controlled through the configuration yaml.

What would you like?