trace.sh 446 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/bash

source $HOME/dragonlab/etc/start.cfg

log=$logpath/$date/traceroute_$1

( flock -n 9 || ( echo "=== could not start traceroute - locked $log.lock ===" ; exit 1 )
  > $log.log

  while true; do
    date "+%s starttime %T" | gzip -c >> $log.gz
#    date "+%s starttime %T"  >> $log.log
    traceroute -q 6 -n $1 2> /dev/null | gzip -c >> $log.gz
#    traceroute -q 6 -n $1 >> $log.log 2>> $log.err 
    sleep 120
  done
) 9> $log.lock