Re: notify if a process take more than X time
On 27 January 2014 17:43, Pol Hallen <deben@fuckaround.org> wrote:
> Hi all,
>
> I need add to my script a notify if a process take more than X time, so
> using ps I can see what time take a process:
>
> ps -ao cmd,etime|grep backup
> /bin/sh ./backup 03:44:55
>
> what's the easy way to do a notify by email?
>
> redirect output of ps to file and use sed for analize the past time, next
> verify with if/then or there's a better way?
>
> any idea?
>
> thanks for help!
>
> Pol
Might be overkill but take a look at ps-watcher package if it is
available in your Debian version.
--
rob
Reply to: