Sponsored Content
Top Forums Shell Programming and Scripting Script to find users not logged in for 90 days Post 302941209 by Sachinlinux on Tuesday 14th of April 2015 02:55:21 AM
Old 04-14-2015
Script to find users not logged in for 90 days

Dear All,

I need your help in finding out users not logged in to linux system for more than 90 days. I found a script from our forum i am getting error while using that.

from the code i have debugged line by line to see where i am getting the problem. i found out the below line i am getting error. I have provided the error details below.
Code:
llogin=$( date +%s -d"$umnt $uday, $year $uhour:$umin:01" )

Code:
Month: Apr  day:9 hour:07 min:45
Date:invalid date `Apr 9,2015 07:47:01`
User login.sh: line 37: 1428580770- : syntax error: operand expected (error token is "_ ")

Pleae help me and let me know If there is any other find the users notlogged in for more that 90days . FYI: I have around 250 users. for some users last command returns null.

I have attached script in which i did slight modification

thanks a lot in advance.

Last edited by Don Cragun; 04-14-2015 at 04:04 AM.. Reason: Change Bold & Quote tags to CODE tags.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to find the number of users logged in

Hi, can u say to display the number of users that logged before me. thanks (10 Replies)
Discussion started by: shanshine
10 Replies

2. UNIX for Dummies Questions & Answers

List all inactive users who has not logged on since last 90 days

Hi, Can I get a script to list out all the users, who has not logged on since last 90 days. Last command in not working due due to /var/adm/wtmpx is more than 2 GB. Thanks in advance. Regards, Roni (10 Replies)
Discussion started by: manasranjanpand
10 Replies

3. Solaris

List all inactive users who has not logged on since last 90 days

I need actuall script which List all inactive users who has not logged on since last 90 days Thanks in advance. Di! (17 Replies)
Discussion started by: haridham
17 Replies

4. Shell Programming and Scripting

Script to check users logged out

Hi, Here is the script that I have written to check if a particular user is has logged out, and if yes, then a mail needs to be sent to the management the details of whatever has been captured by the script command. echo "The current users are:" who | awk '{print $1}' | sort > temp1 cp... (1 Reply)
Discussion started by: ggayathri
1 Replies

5. Shell Programming and Scripting

Script to identify logged users & commands executed

Hi All, I am trying to write a script to get the user information & the command executed. I tried something like this : w | sort | awk '{print$5$6$7}' My requirement is to identify the users who execute the same command at same time. I need the user name & the... (2 Replies)
Discussion started by: vijayarajvp
2 Replies

6. Shell Programming and Scripting

number of users logged in script

My admin needs a shell script in Korn that will show conditions based on users logged in. I have never used the Korn shell and have no clue what I am doing, can anyone help. here are the conditions that need to be returned. if users are below 5 displays should be: performance is high if... (1 Reply)
Discussion started by: vthokiefan
1 Replies

7. Shell Programming and Scripting

find top 4 users currently logged on can i use grep

For the first 4 users only that are currently logged in output their effective user id. It's not important the order in which each logged in i just want to have the top 4. Same question as here...... (0 Replies)
Discussion started by: whyatepies
0 Replies

8. UNIX for Dummies Questions & Answers

how to find top 3 users currently logged on

For the first 3 users only that are currently logged in output their effective user id. thank you. (6 Replies)
Discussion started by: whyatepies
6 Replies

9. Shell Programming and Scripting

Users not logged in for last 90 days

Hi, How to find the users who did not login into a UNIX box (thru ssh/ftp or any other way) for last 90 days? I think of using "finger" or "last" command to findout each user's last login and then find number of days between today and that day. Is there any other better way or anyone prepared... (1 Reply)
Discussion started by: reddyr
1 Replies
ZLOCATE(1)						      General Commands Manual							ZLOCATE(1)

NAME
zlocate - find a user using Zephyr SYNOPSIS
zlocate [ -a | -d ] [ -1 ] [ -p ] user ... DESCRIPTION
Zlocate uses the Zephyr(1) Notification Service to find where a user is currently logged in. If the user is not logged in, or has set his location information such that you do not have access to see it, zlocate prints "Hidden or not logged-in". Otherwise, each machine that the user is currently logged into is printed, along with the time of login and location. The location is usually the X window system dis- play name of the user's display, but may be the terminal name if he is not using X or for some other reason is only using the terminal interface to zwgc(1). By default, all zlocate requests are authenticated using Kerberos. If you do not have Kerberos tickets, or for some other reason do not want to authenticate, the -d option will turn off authentication. The -a option is the default, authentication on. When locating multiple users, zlocate will display the user name on a line by itself, followed by the locations for that user. To display the user name on the same line as the output, use the -1 option (the numeral one). To look up multiple users in parallel asynchronously, use the -p option. DIAGNOSTICS
zlocate exits with status zero (0) if at least one user was found, and one (1) if no users were found. SEE ALSO
zctl(1), zephyr(1), znol(1), zwgc(1), zhm(8), zephyrd(8), X(1) Project Athena Technical Plan Section E.4.1, `Zephyr Notification Service' AUTHORS
Robert S. French (MIT-Project Athena) Marc Horowitz (MIT-Project Athena) RESTRICTIONS
Copyright (c) 1987,1988 by the Massachusetts Institute of Technology. All Rights Reserved. zephyr(1) specifies the terms and conditions for redistribution. MIT Project Athena April 17, 1990 ZLOCATE(1)
All times are GMT -4. The time now is 05:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy