Current time: 11-24-2024, 05:25 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
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #2
RE: [HOW TO] get few last logins on ftp bash->PHP
this is better than: ftpwho or ftptop?

and btw: this not working: who: unrecognized option '--ips'
(This post was last modified: 11-15-2010 04:54 PM by ZiomekPL.)
11-15-2010 04:53 PM
Find all posts by this user Quote this message in a reply
dwander Offline
Junior Member
*

Posts: 18
Joined: Jun 2010
Reputation: 0
Post: #3
RE: [HOW TO] get few last logins on ftp bash->PHP
(11-15-2010 04:53 PM)ZiomekPL Wrote:  this is better than: ftpwho or ftptop?

and btw: this not working: who: unrecognized option '--ips'

yes, because, this is "ftplast" ... which version of who do you have ?
11-15-2010 06:48 PM
Find all posts by this user Quote this message in a reply
ZiomekPL Offline
Junior Member
*

Posts: 20
Joined: Apr 2010
Reputation: 0
Post: #4
RE: [HOW TO] get few last logins on ftp bash->PHP
who (GNU coreutils) 8.5

and i think, that ExtendedLog /var/log/ftp-auth.log AUTH auth
is better for this
11-16-2010 12:46 AM
Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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