You are not logged in.

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

Registered: 2003-01-18
Posts: 145

nohup with notification


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..


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

From: Sweden
Registered: 2010-06-13
Posts: 352

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.

. Main: Intel Core i5 6600k @ 4.4 Ghz, 16 GB DDR4 XMP, Gefore GTX 970 (Gainward Phantom) - Arch Linux 64-Bit
. Server: Intel Core i5 2500k @ 3.9 Ghz, 8 GB DDR2-XMP RAM @ 1600 Mhz, Geforce GTX 570 (Gainward Phantom) - Arch Linux 64-Bit
. Body: Estrogen @ 90%, Testestorone @ 10% (Not scientific just out-of-my-guesstimate-brain)


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

Registered: 2012-05-17
Posts: 2,883

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

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |


Board footer

Powered by FluxBB