You are not logged in.

#1 2012-06-14 09:31:21

Osiris
Member
Registered: 2003-01-18
Posts: 123
Website

nohup with notification

Hello,

I often use nohup cmd & to start long running processes (fluid simulations). Is there a way to be notified when these processes have finished either using nohup or some similiar tool?

My idea is that a jabber xmpp message is sent to me containing the last x lines of output and the return code.

Anybody knows something like that? Anybody interested? Shouldn't be too hard to implement..

Offline

#2 2012-06-15 14:32:54

PReP
Member
From: Sweden/Sala
Registered: 2010-06-13
Posts: 347
Website

Re: nohup with notification

Use screen or tmux instead, and just recheck the session?,

otherwise, you could check if the fluid-stuff makes some sort of log of it's actions,
and make a script - grep or redirect it to something that can mail, send, or show it somehwere you notice, perhaps.


#1 Main: Intel Core i5 2500k (Sandy) @ 3.9 Ghz, 8 GB DDR2-XMP RAM @ 1600 Mhz, Geforce GTX 570 (Gainward Phantom) - Arch Linux 64-Bit
#2 Server: Intel C2D E8400 @ 3.6 Ghz, 3 GB DDR2-RAM @ 802mhz, XFX GF GTX260 XT -ArchLinux 64-bit.

<- Server Homepage: http://prep.mine.nu ->

Offline

#3 2012-06-15 14:53:37

progandy
Member
Registered: 2012-05-17
Posts: 2,146

Re: nohup with notification

Here is some crazy testcode, but it works: Write some lines to stdout, sleep 5 seconds, write another line, read last 2 lines, save to VAR, finally show the content of VAR with notify-send. No output is generated in the terminal

(VAR=`(echo -n "1\n2\n3\n4\n5\n6" ; sleep 5 ; echo -n "\n7") | tail -n 2` ; notify-send "$VAR") >/dev/null 2>/dev/null </dev/null & ; disown

Offline

Board footer

Powered by FluxBB