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