peep a process
Watch a process using $PID and execute specified command for notification when finished. It can also watch a remote command.
% go get github.com/Songmu/peep/cmd/peep
% go get github.com/Songmu/peep/cmd/peep-notify
% brew install Songmu/tap/peep
using ghg
% ghg get Songmu/peep
Built binaries are available on gihub releases. https://github.com/Songmu/peep/releases
% peep [-H user@host -p $PORT] $PID -- peep-notify slack
% peep [-H user@host -p $PORT] $PID -- /path/to/your-notification-script
- peep
- main program
- peep-notify
- bundled command to notify easily which supports slack, pushpullet and mac desktop notification.
The custom notification script accepts a result JSON via STDIN that reports command result like following.
{
"user": "Songmu",
"command": "perl -E say $$; sleep 10",
"startAt": "2018-12-31T17:29:56+09:00",
"endAt": "2018-12-31T17:30:07+09:00",
"host": "localhost",
"pid":20028
}