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?
Changes
1.0.1 Tue Jan 25 18:16:01 EST 2011
Update runner to compare File.basename($0) == File.basename(FILE) so it can run when installed as the gem.
1.0.0 Mon Jan 24 21:15:32 EST 2011
Initial Release