[HOW TO] get few last logins on ftp bash->PHP - Printable Version +- ispCP - Board - Support (http://www.isp-control.net/forum) +-- Forum: ispCP Omega Contributions Area (/forum-40.html) +--- Forum: Howtos (/forum-41.html) +--- Thread: [HOW TO] get few last logins on ftp bash->PHP (/thread-12083.html) |
[HOW TO] get few last logins on ftp bash->PHP - dwander - 11-09-2010 06:09 PM Code: who --ips /var/log/wtmp | grep ftpd | awk '{print $3" "$4" "$1";"$3";"$4";"$5}' | sort -r | awk '{print $3}' If you save output of this command to a file (use ">" instead of ">>"), then you can easy parse it with php function "fgetcsv" ... needle is ";". This shows only few last logins, writed after last logrotate. enjoy. RE: [HOW TO] get few last logins on ftp bash->PHP - ZiomekPL - 11-15-2010 04:53 PM this is better than: ftpwho or ftptop? and btw: this not working: who: unrecognized option '--ips' RE: [HOW TO] get few last logins on ftp bash->PHP - dwander - 11-15-2010 06:48 PM (11-15-2010 04:53 PM)ZiomekPL Wrote: this is better than: ftpwho or ftptop? yes, because, this is "ftplast" ... which version of who do you have ? RE: [HOW TO] get few last logins on ftp bash->PHP - ZiomekPL - 11-16-2010 12:46 AM who (GNU coreutils) 8.5 and i think, that ExtendedLog /var/log/ftp-auth.log AUTH auth is better for this |