I found out that I had an Oracle DB with all the info I needed. I was able to build a script and have it run via cron once a week. Thanks a lot for all your help.
Well I am showing my true colors here. I have run into another snag that I hope you guys can help me with. I built the script to email the results to myself and it worked fine from the command line. When I put it into the crontab it blew up. This is the script:
#!/usr/bin/ksh
cd...
Ok, I found a way this is what I did:
#!/usr/bin/ksh
print "select user_id, last_login_dt from users where last_login_dt < sysdate - 180;" | sqlplus $DB_LOGIN/$DB_PASSWORD > lastlogin.txt
It worked great!
Know I just need to do the emailing.
Thanks a lot guys.
Ok, I used the example from the referenced post you gave me. It worked directly from the command line as:
print "select user_id, last_login_dt from users where last_login_dt < sysdate - 180;" | sql > lastlogin.txt
This worked great for what I wanted to do. It redirected everything to a...
Yes this is related to that thread. I discovered that the info I needed was stored on an Oracle database. I am really new at this, so what is "parse the output
Ok, I am extremely new to SQL. I have a problem where I need to set up an automated query to run every friday at 6pm and email the results to myself and two other persons. The table is 'users' and the fields that I am interested in are the 'user_id' and 'last_login_dt'. I need to know who has...
Ok, I have found where the logins are stored. They are in the /var/adm/wtmp file, and listusers will tell me all the users that are on the system. Does anybody know how I would compare the two files to determine who has not logged in in the last 6 months or 180 days? The wtmp file only goes...
I am new to the UNIX world and was given a small project to do. I need to build a little script to tell me who has not logged into the system for the last 180 days. I also need to have it email the results to my email address once a week. Any help would be greatly appreciated.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.