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