04-19-2014
Script to append user details as soon as he logs in
I'm wishing to create a log myself where I wish to:
1.Write a script in /bin folder to make a separate log in var/log folder &
2.Call the script in bashrc each time a user logs in, I'm trying to avoid CRONJOB as it would take too much of my memory after iterations. So I just need to append the user details (user id, ip, date, time & duration of login)
The usage of bashrc isn't particularly clear to me and as and when someone logs in, I need that login detail to be appended to the log immediately. I think you understand what I'm trying to do without using too much of memory and space.
What script should I use? & how should I proceed with bashrc?
Last edited by Lionking93; 04-19-2014 at 07:39 PM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
OS:sol8
ok 2 things are very important. I will give examples of the logs and the client file for testing.
Object: to display on the web sometime to parse your custom logs basied on the inputed date and client selected.
I know alot of ppl are like who care. but i saw a perl script on here... (1 Reply)
Discussion started by: Optimus_P
1 Replies
2. Shell Programming and Scripting
I have to write a shell script like this--
1) Utility will be run under the directory owner.
2) This utility will clean files in ABC/logs. And following logs will be backed up or deleted.
Dispatcher Logs
Middle tier Logs
Sage log
Sage monitor log
Sage db clean up result log
Core files ... (12 Replies)
Discussion started by: namishtiwari
12 Replies
3. Solaris
how can i identifying whose are logged in last few days,time and date also want. what i will do for get that information (2 Replies)
Discussion started by: sijocg
2 Replies
4. Shell Programming and Scripting
Hi,
I have a linux redhat 9 server and I am concerned about the security on that server.
I would like to be able to write a script that records all the commands that were typed at the command prompt before the user calls the 'history -c' command and deletes all the history.
I was thinking about... (4 Replies)
Discussion started by: mishkamima
4 Replies
5. Solaris
Hi
We are sharing our envoirnment with our component teams. the plateform is SunOS 5.8 Generic_117350-41 sun4u sparc SUNW,Sun-Fire-V490.
All team logs in the domain with same user and perform activities.
Now for the system auditing purpose can somebody guide me how can I get the details when... (6 Replies)
Discussion started by: sukhvinder_Tm
6 Replies
6. UNIX for Dummies Questions & Answers
i want to collect new logs only from a existing logfile and the new logs should be written both existing logfile and a new file..
which command i have to use for this.
Regards
Vijay, (0 Replies)
Discussion started by: vijayq8
0 Replies
7. Shell Programming and Scripting
So I have a script that runs as a non-root user, lets say the username is 'xymon' .
This script needs to log on to a remote system as a non-root user also and call up a bash script that runs another bash script as root.
in short: user xymon on system A needs to run a file as root user and have... (2 Replies)
Discussion started by: damang111
2 Replies
8. UNIX for Dummies Questions & Answers
Hi I'm new to Shell scripting .Can anyone please help me how to capture user's login and logout details and load them into a table...
we are using Oracle DB on UNIX:confused: (3 Replies)
Discussion started by: rajmohan146
3 Replies
9. Shell Programming and Scripting
Appreciate help for the below issue.
Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt..............
1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I have a requirement to get the address values from a large log file along with the user details.
line1,line2,city,stateCode,postalCode,countryCode. The below code as advised in the earlier post is giving the user data
zgrep -B1 "Failed to calculate Tax" log.2018-05-23.gz | grep... (8 Replies)
Discussion started by: nextStep
8 Replies
LEARN ABOUT DEBIAN
penlogd
PENLOGD(1) General Commands Manual PENLOGD(1)
NAME
penlogd - consolidate web server logs
SYNOPSIS
penlogd [-fd] [-j dir] [-l logfile] [-n N] [-p pidfile] [-u user] port
EXAMPLE
penlogd -l /var/log/access_log -p /var/run/penlogd.pid 10000
DESCRIPTION
Penlogd receives log entries from Pen and from each of the web servers. It consolidates the entries by replacing the source addresses in
each entry with the "real" client address and writes the result to stdout or to the file given on the command line. This completely
removes the need for postprocessing with mergelogs, since the logs are already merged.
Pen must be instructed to send its log to penlogd. See HOWTO and pen man page for details.
Sending penlogd a HUP signal will make it close and reopen the logfile, unless it is logging to stdout. Rotate the log like this:
mv access_log access_log.1 kill -HUP `cat <pidfile>`
where <pidfile> is the file containing pen's process id.
Sending penlogd a TERM signal will make it close the log file and exit cleanly.
OPTIONS
-d Turn on debugging. The output goes to stderr if we are running in the foreground (see -f) and to syslog (facility user, priority
debug) otherwise.
-f Stay in foreground.
-j dir Run in a chroot environment.
-l logfile
Write output into logfile.
-n N Number of pen log entries to cache (default 1000).
-p pidfile
Write process id into pidfile.
-u user
Run as a different user.
port The UDP port where penlogd receives log entries.
SEE ALSO
pen(1), penlog(1), webresolve(1)
AUTHOR
Copyright (C) 2002-2003 Ulric Eriksson, <ulric@siag.nu>.
LOCAL PENLOGD(1)