Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2008 09:56 PM
10-13-2008 09:56 PM
we need script for the current ftp login users list from "last" command output.
Pls help me.
Thanks & Regards,
Suresh
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2008 10:22 PM
10-13-2008 10:22 PM
Re: Script
Do you want to check which users that last(1) shows were from ftp? What do you mean by "current", who(1) would do that better.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2008 10:57 PM
10-13-2008 10:57 PM
Re: Script
We need to edit the ftp login details only in last command output and put it to file.
Eg:
$ last |grep -i ftp |more
sankar ftp 10.12.22.95 Oct 13 07:42 - 07:43 (00:00)
sankar ftp 10.12.22.95 Oct 11 10:12 - 10:25 (00:13)
sasi ftp 10.13.13.82 Oct 09 15:17 - 15:18 (00:00)
sasi ftp 10.13.13.82 Oct 09 15:13 - 15:17 (00:03)
Note: i need current ftp login users details only.Pls help me.
Regards,
Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 01:25 AM
10-14-2008 01:25 AM
Re: Script
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 01:58 AM
10-14-2008 01:58 AM
Re: Script
How to edit current date(today) ftp login users in last command output.
Regards,
Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 02:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 01:30 PM
10-14-2008 01:30 PM
Re: Script
Since last(1) takes a user name, you can remove that part of the grep.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 07:24 PM
10-14-2008 07:24 PM
Re: Script
I executed last |grep -i ftp | grep "`date +"%-4.4h%d"`" |more in our server, it displays last 3 years ftp login details not current details.But i need current date and current year ftp login details only.After that i can schedule this script in autommatic for regular basis.
Please help me.
Regards,
Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 07:57 PM
10-14-2008 07:57 PM
Re: Script
pls try ,
last |grep ftp |grep -i "'date -u " |more
Thanks,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 08:02 PM
10-14-2008 08:02 PM
Re: Script
Regards,
Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 08:13 PM
10-14-2008 08:13 PM
Re: Script
reason for no output suspecting no ftpusser login or you try by yourself by ftp localhost
than pls try command again,
Thanks,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 08:32 PM
10-14-2008 08:32 PM
Re: Script
last |grep -i ftp |more command output gives 3 ftp user login details
enovia ftp Wed Oct 15 09:38 still logged in
enovia1 ftp Wed Oct 15 09:36 - 09:38 (00:01)
enovia2 ftp Wed Oct 15 09:36 - 09:36 (00:00)
last |grep ftp | grep -i date -u | more - no output
Regards,
Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 08:33 PM
10-14-2008 08:33 PM
Re: Script
last |grep -i ftp |more command output gives 3 ftp user login details
enovia ftp Wed Oct 15 09:38 still logged in
enovia1 ftp Wed Oct 15 09:36 - 09:38 (00:01)
enovia2 ftp Wed Oct 15 09:36 - 09:36 (00:00)
last |grep ftp |grep -i "'date -u " |more - no output
Regards,
Suresh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 08:48 PM
10-14-2008 08:48 PM
Re: Script
FYI,
Lovro VRES : Command works fine for me..
Please see below
$ last |grep -i ftp | grep "`date +"%-4.4h%d"`"
ibmadm1 ftp Wed Oct 15 12:36 - 12:36 (00:00)
ibmadm1 ftp Wed Oct 15 12:14 - 12:14 (00:00)
$ uptime
12:37pm up 43 days, 20:20, 8 users, load
average: 0.22, 0.23, 0.21
Your server uptime should be more than 3 years can you please check you time stamp for your wmtp file
ll /var/adm/wtmp
-rw-rw-r-- 1 adm adm 534420 Oct 15 12:36 /var/adm/wtmp
if the time-stamp of your /var/adm/wtmp is old that's why your able to see the ftp login for last 3 years
man last --> command for more info
Thanks,
Johnson
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-14-2008 09:22 PM
10-14-2008 09:22 PM
Re: Script
You can't limit it to the current year without advanced AI technology.
MK mentioned how to find ftp still logged on:
last ftp | grep "still logged in"
(Using ftp will give anonymous ftp only. Is that what you want?)
Lovro mentioned how to get the current date:
last | grep "$(date +"%h %d")"
Ah, here is your advanced AI technology:
/usr/sbin/acct/fwtmp -X < /var/adm/wtmps |
grep "ftp.*$(date +"%h %d.*%Y")"