Script genius needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some months ago I asked here if there were a way to log my ISP's downtime, 
and got a useful answer. Today I've been attempting to refine it a bit, 
and there is some progress, but not success.

Here's what I have:

[code]
#!/bin/bash
#monitor frontier communications downtime
ping -i 3 -O -D 1.1.1.1 | while read row 
do 
  awk '{ sub(/[0-9]{10}/, strftime("%Y-%m-%d %H:%M:%S", substr($0,2,10))) }
1' <<< "$row"| tee ~/frontier_downtime.log
done
[/code]

Most of it is simply converting internet time to human time, because I 
might have to use it to support a complaint. It runs fine in a terminal, a 
nice ping and result every three seconds, but only writes the first line, 
the first ping result, to the logfile. (And yes, ir's probably sloppy.)

What do I have wrong?

Bonus question: any way to keep it running with the terminal closed? I 
can't even use & to free the terminal; I'd like to start the thing and 
have it cook merrrily away without a terminal open or even minimized, and 
use top or killall to dispose of it if that becomes necessary.

I'm pretty sure I'm missing something obvious.
-- 
dep

Pictures: http://www.ipernity.com/doc/depscribe/album
Column: https://ofb.biz/author/dep/

____________________________________________________
tde-users mailing list -- users@xxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxx
Web mail archive available at https://mail.trinitydesktop.org/mailman3/hyperkitty/list/users@xxxxxxxxxxxxxxxxxx




[Index of Archives]     [Trinity Devel]     [KDE]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]     [Trinity Desktop Environment]

  Powered by Linux