#!/bin/bash awk '{print $3,$4,$5,$6,$9,$11,$12,$14,$15,$18}' /usr/local/tcacheserver/var/log/trafficserver/access.log_*`date -d"0 day ago" +"%Y%m%d"`* > /usr/local/src/10.254.33.17_access.log_`date -d"1 day ago" +"%Y-%m-%d"` #FTPHOST="10.254.26.112" FTPHOST="10.254.31.89" USERNAME="dnion" PASSWORD="dnion123" y=`date --date='1 days ago' "+%Y"` m=`date --date='1 days ago' "+%m"` d=`date --date='1 days ago' "+%d"` yt=`date "+%Y"` mt=`date "+%m"` dt=`date "+%d"` y1=`date "+%Y"` m1=`date "+%m"` d1=`date "+%d"` SRCFILE="10.254.33.17_access.log_$y-$m-$d" #DESFILE="10.254.27.22_test.zip" DESFILE="10.254.33.17_access.log_$y1-$m1-$d.zip" FILEPATH="/usr/local/src" cd $FILEPATH zip $DESFILE $SRCFILE ftp -v -n $FTPHOST << END user $USERNAME $PASSWORD binary put $DESFILE bye END cd $FILEPATH rm -f $DESFILE #end