我想从proftpd使用的xferlog格式转换成每个用户input/输出字节,以获得每个用户每月使用多lessstream量的摘要。
xferlog的确切格式是这样的:
Thu Oct 17 12:47:05 2013 1 123.123.123.123 74852 /home/vftp/doc1.txt b _ ir user ftp 0 * c Thu Oct 17 12:47:06 2013 2 123.123.123.123 86321 /home/vftp/doc2.txt b _ ir user ftp 0 * c
这是生成我现在使用的脚本的格式:
User example.com user1 transferred (out/in) 0 / 20K, total 20K User example.com user2 transferred (out/in) 6.1K / 6.1K, total 13K User example.com user3 transferred (out/in) 173M / 173M, total 346M
你可以从这里下载脚本
由于找不到所需的脚本,我自己创build了脚本。 你可以在bitbucket.orgfind它,随时使用它,并发送你有任何问题。