Write a scripts to kill idle user for 60 min. & email user list to admin in text file
Folks,
I have written one script for following condition by referring some of online post in this forum. Please correct it if I'm missing something in it. (OS: AIX 5.3)
List the idle user. (I used whoidle command to list first 15 user and get username, idle time, pid and login time). Any other suggestion to get all the user at once including above things?
Exclude few users from list (system user and admin user)
Calculate idle time(if user is more than 60 min idle)
Make entry of that user in log file (If possible I want to create text file)
Email log file to admin
Sleep for 5 min. after emailing total list of user to admin
Kill the users in list
Loop it to reach next 15 users. (If possible I want to get rid of this condition by following all idle user list command with pid's)
I need to put this code in production as soon as possible.
Expert please throw some light on it.
Thanks in advance.
Sumit
folks;
I created a new users on my SUSE box and i need to give this user/group a read write access to one specific folder. here's the details:
- I created new user "funny" under group "users".
- I need to give this user "funny" a read/write access to another directory that is owned by "root".... (3 Replies)
Hi
I am using mailx to send email and am wondering if there is a way I can send the email from a different user than the user logged in.
something like do-not-reply@xyz.com
Thank you. (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
(o) Checkout an auto part: should prompt the user for the name of the auto part
and borrower's name:
Name:... (2 Replies)
Hello..
I have many sleepy users on my Solaris box and need to kill them if they are idle for more than 45 minutes for example...I know who -u gives and the idle time but unable to make a awk line to get the condition perfect. Please help...:wall: (9 Replies)
Can anyone create or give me a script that I can use to email a user automatically when I kill one of their processes?
Or
Can you give me a script to allow me to email a user (entering email manually) when a process is killed? Like showing what the PID was and a reason the admin killed it? Is... (2 Replies)
hi,
i am new in unix.......i am using bash and i want to create a user which has only some command and scripts permission.........is it possible?
thanx (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Write a script called user.sh that parses the name and password of given in a file (user.txt) and creates the user... (1 Reply)
Dear All,
It would be really nice, if you could help me to write a script for deletion of list of user( more than 15000 users) stored in a file and sorted by email address( i need deletion of only a particular type of mail address).
Is the any script to write and take the file as input and... (3 Replies)
Discussion started by: Chand
3 Replies
LEARN ABOUT MOJAVE
update
update(n) Tcl Built-In Commands update(n)
__________________________________________________________________________________________________________________________________________________NAME
update - Process pending events and idle callbacks
SYNOPSIS
update ?idletasks?
_________________________________________________________________DESCRIPTION
This command is used to bring the application "up to date" by entering the event loop repeatedly until all pending events (including idle
callbacks) have been processed.
If the idletasks keyword is specified as an argument to the command, then no new events or errors are processed; only idle callbacks are
invoked. This causes operations that are normally deferred, such as display updates and window layout calculations, to be performed imme-
diately.
The update idletasks command is useful in scripts where changes have been made to the application's state and you want those changes to
appear on the display immediately, rather than waiting for the script to complete. Most display updates are performed as idle callbacks,
so update idletasks will cause them to run. However, there are some kinds of updates that only happen in response to events, such as those
triggered by window size changes; these updates will not occur in update idletasks.
The update command with no options is useful in scripts where you are performing a long-running computation but you still want the applica-
tion to respond to events such as user interactions; if you occasionally call update then user input will be processed during the next
call to update.
EXAMPLE
Run computations for about a second and then finish:
set x 1000
set done 0
after 1000 set done 1
while {!$done} {
# A very silly example!
set x [expr {log($x) ** 2.8}]
# Test to see if our time-limit has been hit. This would
# also give a chance for serving network sockets and, if
# the Tk package is loaded, updating a user interface.
update
}
SEE ALSO
after(n), interp(n)
KEYWORDS
event, flush, handler, idle, update
Tcl 7.5 update(n)