You are not logged in.

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

Osiris
Member
Registered: 2003-01-18
Posts: 157
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
Registered: 2010-06-13
Posts: 359
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.


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

Offline

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

progandy
Member
Registered: 2012-05-17
Posts: 5,191

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

Offline

Board footer

Powered by FluxBB