- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Dormant Users
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
02-15-2006 01:41 AM
02-15-2006 01:41 AM
Need a shell script that can tell the users who have not logged into the box since X no. of days eg 90 days ..
Need to work on login and last command
Cheers
Vipul
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 02:26 AM
02-15-2006 02:26 AM
Re: Dormant Users
# Not logged in days
NOT_LOGGED_DAYS=90
# Get NOT_LOGGED_SEC seconds
NOT_LOGGED_SEC=`date --date "$NOT_LOGGED_IN days ago" +%s`
# Last logged
LAST_LOGGED=`date --date "$(last -1 $1 | grep -v begins | awk '{ print $4,$5 }')" +%s`
if [ $LAST_LOGGED -lt NOT_LOGGED_SEC ]; then
echo "The user $1 did not logged in $NOT_LOGGED_DAYS days"
else
echo "This user is not a dormitant user"
fi
Usage:
script_name username
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 02:33 AM
02-15-2006 02:33 AM
Re: Dormant Users
Thanks for your response.
I dont want to do it one by one.
I need a script that compares /etc/passwd and logins output and shows those users who have not logged in since 90 days..
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 03:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 04:30 AM
02-15-2006 04:30 AM
Re: Dormant Users
The script is great!!!
just wonder if it could show the year of login as well i.e whether it was 2005 or 2006
Human Nature: Always demanding!!
Cheers
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 05:38 AM
02-15-2006 05:38 AM
Re: Dormant Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2006 10:07 PM
02-15-2006 10:07 PM
Re: Dormant Users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2006 09:41 PM
03-29-2006 09:41 PM
Re: Dormant Users
there is 1 script but doesnt seem to give corret results..
is there a script that give full details of users who have'nt logged in since x no of days and also when was there last login etc..
cheers