LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-04-2010, 03:51 AM   #1
aiushtha
LQ Newbie
 
Registered: Jul 2010
Posts: 11

Rep: Reputation: 3
Question I Need Fantastic Script for Loging


Hi,
I need;
1- X user login to server
2- X user used command du,mkdir,cat .. etc.
3- 1-2 actions and included command print send specified emails.


How can I do? Thanks.
 
Old 11-04-2010, 05:03 AM   #2
genderbender
Member
 
Registered: Jan 2005
Location: US
Distribution: Centos, Ubuntu, Solaris, Redhat
Posts: 396

Rep: Reputation: 31
My advice would be to:
1. Using lastb get the last users to login to the server, it's upto you how you use this data (print $1 would give you the user name, but you'd get duplicates).
2. Stick this in a for loop and do for user in `the query above which shows only the usernames`; do cat /home/$user/.bash_history; done;
3. Don't get this. I'm not writing the script for you though, I'll help with anything you've wrote so far, but I think it's unfair to come here just demanding code also - it sounds like homework.

I'm sure there are better more intelligent ways of achieving the same thing anyway.
 
Old 11-04-2010, 06:11 AM   #3
HasC
Member
 
Registered: Oct 2009
Location: South America - Paraguay
Distribution: Debian 5 - Slackware 13.1 - Arch - Some others linuxes/*BSDs through KVM and Xen
Posts: 329

Rep: Reputation: 55
Quote:
Originally Posted by aiushtha View Post
Hi,
I need;
1- X user login to server
2- X user used command du,mkdir,cat .. etc.
3- 1-2 actions and included command print send specified emails.


How can I do? Thanks.
come back when you have some code to show, *then and only then* ask for help
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Open Data: Fantastic, But Not Enough LXer Syndicated Linux News 0 06-02-2010 07:51 PM
LXer: Pardus 2009 Looks Fantastic LXer Syndicated Linux News 0 07-17-2009 03:00 AM
shell script to find out who is loging to server and kill that connection. atul.bairagi Linux - Newbie 1 03-22-2009 07:43 AM
fantastic thing you are doing tovorinok Linux - General 3 07-05-2007 09:12 AM
Dinosaur Technology -- But fantastic Fun 1kyle Linux - Software 6 03-31-2004 03:21 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration