Current time: 12-26-2024, 10:54 PM Hello There, Guest! (LoginRegister)


Post Reply 
[HOW TO] get few last logins on ftp bash->PHP
Author Message
dwander Offline
Junior Member
*

Posts: 18
Joined: Jun 2010
Reputation: 0
Post: #1
[HOW TO] get few last logins on ftp bash->PHP
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.
11-09-2010 06:09 PM
Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
[HOW TO] get few last logins on ftp bash->PHP - dwander - 11-09-2010 06:09 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)