Visit Our UNIX and Linux User Community

help to create script for added date to list users

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help to create script for added date to list users
# 1  
Old 05-13-2011
help to create script for added date to list users

hi my friends
im asking for the possibility to creat a script in ubuntu for added date to list users for doing this :

- search in debug connected user of all connected users
- if a new user is connect for the first time to my server
the script record the date of the connection and added it to my list user
where i have an other script to delet expired users

- like this :
user : test2 is in my user.cfg in this form =
user:test1 passeword:test1
user:test2 passeword:test2
user:test3 passeword:test3

when this user is connect in the first time in this date = 12-05-2011

the script record this date and added it to the line user of the user test & become like this
user:test1 passeword:test1 #11-04-2011
user:test2 passeword:test2 #12-05-2011
user:test3 passeword:test3

Last edited by amzioujda; 05-13-2011 at 10:06 AM..
# 2  
Old 05-17-2011
Perhaps you used a bad approach...
Consider giving here the script you wrote explaining where you are stuck or what you dont know how to do, then say "how can I solve this problem?". If you look at the forum you will see that more you give information and show what you are doing, more replies (and good ones...) you get. You don't expect others to do your work, no?

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Create summery of al users + date

Hello, I have problem to write script which can collect users "username" and the time that each user has been created in our machine and store these data in file database.txt I have searched a lot and found we can see the exact time we create user with:passwd -S username also list user will... (3 Replies)
Discussion started by: nimafire
3 Replies

2. Shell Programming and Scripting

Shell Script to filter users and create them again from a back-up server

This is a script to filter the users out of etc/passwd and etc/group. So if you want to migrate of restore a server you can use this script from a backup to restore and make the same users on you had.. Please feedback and comments. #!/bin/bash prompt_list () { # haal uit de argumenten de... (5 Replies)
Discussion started by: dannyvdberg
5 Replies

3. Shell Programming and Scripting

Create users from a text file by script

Hi All, I am new to scripting, i want to create one script in which i can add users from a text file, assign them a default password like 123456. It should be like: Username= $i (it should take users from text file one by one) Password : 123456(default for every user) (1 Reply)
Discussion started by: prad_rocxx
1 Replies

4. Shell Programming and Scripting

Help with script to create users from database query

#!/bin/bash user=`mysql userList -uuserlist -puserlistpassword -s -N -e "SELECT userName FROM users WHERE activated='n'"` for i in $user; do useradd "$i" -m doneThis is what I have done so far. But obviously it still does not work. I'm trying to create users based on information stored in a... (5 Replies)
Discussion started by: bucketuk
5 Replies

5. Shell Programming and Scripting

Create new users in DMZ box using script

I remote to many DMZ boxes every day to run batch file that allows me to create users. I create users in 17 DMZ boxes every day which takes a lot of my time. Is there any script that would do this job from my local computer? Thank you for your help! (3 Replies)
Discussion started by: idiazza
3 Replies

6. Solaris

su: No shell/No directory! if sys is added to a users secondary group

Hi, When I include a user to the secondary group "sys" GID=3 in Solaris 9 OS I'm not able to login. I get these error. The user home directory and the shell exists. Is this because of any security hardening. # su - agent No directory! # su agent su: No shell # grep taddm /etc/passwd... (14 Replies)
Discussion started by: agent001
14 Replies

7. UNIX for Dummies Questions & Answers

How to do a login time and date list of users never logged on?

Hello, I'm trying to do a list of user that never connected to a couple of servers. I want to do a diff between the servers lists, and print out only the users that never has logged on each server. Here my first step : SERVER01: # finger `egrep -v -e "^\s*#" /etc/passwd | awk '{ print $1 }' |... (4 Replies)
Discussion started by: gogol_bordello
4 Replies

8. OS X (Apple)

interactive shell script to create users 10.4

Hello everyone, Not sure if this is the right place, but OS X isn't your standard Unix, so I figured here would be best. I am looking at creating a script that will be interactive that admins can run to create users. Now, 10.4 uses netinfo database and netinfo manager to handle it's users. ... (3 Replies)
Discussion started by: tlarkin
3 Replies

9. UNIX for Dummies Questions & Answers

Create a list of files that were modified after a given date.

Hello Mates! I'm kinda new to unix and need to a solve a problem. Input: date Situation: With the given date I need to find a list of all such files starting from a given path that were modified after the given date. I experimented with the "find" with "-newer" but did not quite get it... (4 Replies)
Discussion started by: rkka
4 Replies

10. Shell Programming and Scripting

script to create users on many servers

Hi all, working on script to create a user acct on all our servers. for i in `cat $host_file`; do ssh $i /usr/bin/sudo /usr/bin/mkuser id='bpadm' gecos='NetBackup Admin' 2>&1 >> $log done error i get is: 3004-692 Error changing "id" to "bpadm" : Value is invalid. I have tried this in... (1 Reply)
Discussion started by: dnidiffer
1 Replies

Featured Tech Videos