#!/bin/Sh#today= ' Date +%y%m%d ' year= ' echo $ '1|cut-c1-4' MONTH= ' echo $ '1|cut-c5-6' Day= ' echo $ '1|cut-c7-8' time= $YEAR-$MONTH-$DAY #echo ' Date-D"$TIME-2 Day"+%y-%m-%d ' URL="/home/work/webdata/logs/focusapi_access_log.$1"#昨天的日期 #yes_dt= ' date-d"-1day"+"%y-%m-%d"' Yes_day= ' date-d"$TIME -1day"+%y-%m-%d ' #最近7天last_7day= ' date-d"$TIME -7day"+%y-%m-%d ' #最近30天last_30day= ' date-d"$TIME -30day"+%y-%m-%d ' Declare Date_array=(xx on Geneva Geneva Geneva to . - , the Ten One A - - the - - - + - + A at) forHourinch${date_array[@]}; DoCmd_yes_day= ' grep'focus/getgoodsinfodaily'$url $hour | Grep'start='$yes _day'&end='$yes _day | WC-l ' cmd_last_7day= ' grep'focus/getgoodsinfodaily'$url $hour | Grep'start='$last _7day'&end='$yes _day | WC-l ' cmd_last_30day= ' grep'focus/getgoodsinfodaily'$url $hour | Grep'start='$last _30day'&end='$yes _day | WC-l ' echo"yesterday:"$cmd _yes_day"-----Last 7 days:"$cmd _last_7day"-----Last 30 days:"$cmd _last_30daydone
Shell Time Statistics Script