[root@dev_M01 BINLOG]# ls -l --time-style=long-iso * | grep -v "index" | awk '{
key=$6;
cnt[key] ++;
sum[key] += $5;
}
END {
printf "======================================\n";
printf " Date Count Size(MB) \n";
printf "======================================\n";
for (dt in cnt)
{
tcount = tcount + 1;
vcnt = vcnt + cnt[dt];
vsum = vsum + sum[dt];
printf "[%s] : \t%d\t%+12s\n", dt, cnt[dt], sum[dt]/1024/1024
}
printf "======================================\n";
printf "Avg Per Day : \t%d\t%+12d\n", (vcnt / tcount), (vsum/1024/1024/tcount);
printf "======================================\n";
}'
======================================
Date Count Size(MB)
======================================
[2015-02-09] : 1 0.00364113
[2015-02-10] : 3 185.123
[2015-02-11] : 1 0.00479031
======================================
Avg Per Day : 1 +61
======================================
'연구개발 > MYSQL' 카테고리의 다른 글
MySQL optimize/analyze table (0) | 2015.02.18 |
---|---|
cursor 커서 (0) | 2015.02.17 |
Linux time. (real, user, sys) (0) | 2015.02.10 |
[모니터링] 쿼리 (0) | 2015.02.10 |
MySQL NF 5.6 - Enhanced tracing (SQL Trace 방법) (0) | 2015.02.09 |