notify if a process take more than X time

2014-01-27 Thread Pol Hallen
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 ./backup03: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

Re: notify if a process take more than X time

2014-01-27 Thread Lars Noodén
On 27.01.2014 19:43, Pol Hallen 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: [snip] Maybe use timeout(1) to send a signal (e.g. USR1) and have your script trap that signal and send a mail when it receives

Re: notify if a process take more than X time

2014-01-27 Thread Karl E. Jorgensen
Hi On Mon, Jan 27, 2014 at 06:43:20PM +0100, Pol Hallen 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 ./backup03:44:55 what's the easy way to do a notify

Re: notify if a process take more than X time

2014-01-27 Thread Pol Hallen
Hello Lars and thanks for your reply Maybe use timeout(1) to send a signal (e.g. USR1) and have your script trap that signal and send a mail when it receives it? something like it, yep if a process take long time, I need have a notification by email without change executing of that process.

Re: notify if a process take more than X time

2014-01-27 Thread Robin
On 27 January 2014 17:43, Pol Hallen de...@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 ./backup03:44:55 what's the easy way to do a notify