#!/bin/bash # # Author: Alexander V. Konstantinou (akonstan@cs.columbia.edu) # LOG_DIR=/import/http/LOGS.www DEST_FILE=$HOME/Unix/lib/logs/access_log AWK=/usr/local/gnu/bin/gawk DATE_EXEC=$HOME/Unix/bin/script/date-http GREP=/usr/local/gnu/bin/grep if [ `hostname` != "sutton.cs.columbia.edu" ]; then echo "$0: must be executed on host sutton" exit 1 fi if [ -z "$1" ]; then BACK=1 else BACK=$1 fi if [ ! -d "$LOG_DIR" ]; then echo "$0: $LOG_DIR is not a directory !" exit 1 fi DATE=`$DATE_EXEC $BACK` if [ -f $LOG_DIR/access_log.1.gz ]; then /usr/local/gnu/bin/gunzip -c $LOG_DIR/access_log.1.gz | $GREP "$DATE" | $GREP -v 'aqua\.cs\.columbia\.edu' | $GREP akonstan >> $DEST_FILE elif [ -f $LOG_DIR/access_log.1 ]; then $GREP "$DATE" $LOG_DIR/access_log.1 | $GREP -v 'aqua\.cs\.columbia\.edu' | $GREP akonstan >> $DEST_FILE fi if [ -f $LOG_DIR/access_log.2.gz ]; then /usr/local/gnu/bin/gunzip -c $LOG_DIR/access_log.2.gz | $GREP "$DATE" | $GREP -v 'aqua\.cs\.columbia\.edu' | $GREP akonstan >> $DEST_FILE fi $GREP "$DATE" $LOG_DIR/access_log| $GREP -v 'aqua\.cs\.columbia\.edu' | $GREP akonstan >> $DEST_FILE