root@X:[/etc/logrotate.d]: cat /etc/logrotate.d/vsftpd /var/log/vsftpd.log { create 640 root adm # ftpd doesn't handle SIGHUP properly missingok notifempty rotate 4 weekly prerotate echo "<html><body><table>$(grep "OK LOGIN" /var/log/vsftpd.log | awk '{print $8" "$12'} | sort | uniq -c | awk '{print "<tr><td>"$2"</td><td>"$3"</td><td>"$1"</td></tr>"}')</table></body></html>" | mail -a "Content-type: text/html" -s 'FTP REPORT' mail@domain.com endscript }