Commit dc7188f1 authored by Vitaly Lipatov's avatar Vitaly Lipatov

grflog: fix, add truncate

parent a45819ef
#!/bin/sh #!/bin/sh
RES=pub VOLUME=ftp-pub
VOLUME=ftp-$RES [ -n "$1" ] && VOLUME="$1" && shift
RES=${VOLUME/ftp-}
LOCALPATH=/var/ftp/$RES LOCALPATH=/var/ftp/$RES
GLUSTERLOG=/var/log/glusterfs/var-ftp-$RES.log GLUSTERLOG=/var/log/glusterfs/var-ftp-$RES.log
# server hack
[ "$RES" = "pub" ] && GLUSTERLOG=/var/log/glusterfs/var-ftppub-pub.log [ "$RES" = "pub" ] && GLUSTERLOG=/var/log/glusterfs/var-ftppub-pub.log
[ -n "$1" ] && GLUSTERLOG="$1" && shift
grep_dht_log() grep_dht_log()
{ {
...@@ -15,6 +20,7 @@ grep_dht_log() ...@@ -15,6 +20,7 @@ grep_dht_log()
# use mount # use mount
grep_dht_log $GLUSTERLOG | sed -e "s|.*dht_lookup_everywhere_cbk\] 0-\($VOLUME\)-dht: \(.*\)|\1: \2|g" > $0.$VOLUME.log grep_dht_log $GLUSTERLOG | sed -e "s|.*dht_lookup_everywhere_cbk\] 0-\($VOLUME\)-dht: \(.*\)|\1: \2|g" > $0.$VOLUME.log
truncate -c -s0 $GLUSTERLOG
sort -u < $0.$VOLUME.log >$0.$VOLUME.sorted.log sort -u < $0.$VOLUME.log >$0.$VOLUME.sorted.log
TASKFILE=$0.task TASKFILE=$0.task
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment