Hi there, i've been searching all over and i thought i had understood the way i should go to kill all the processes related to a user. But i'm getting more confused then i was.
By lunch time i have to make a database backup, and for that all the users shoul logout. The problem is that many users don't have the trouble logging out , so before i start the backup i have to kill them all. I've tryed some scripts , and tryed to adapt them to my needs, but all that i found would kill by process name , or using the pid.
I need some script that would ask me for the user to kill , and given the username it would kill all the processes running by tht user.
How can i do this?
i was trying to use this
printf "\n\nUsername to kill?"
read nUsername
[ "$nUsername" ] || exit
ps -u $nUsername | awk -v nUid="nUid" '
{
if ( $1 == nUid )
kill -9 $2
}'
sorry, no great knowleage about scripting
thanks