pjoshi Posted August 4, 2009 Share Posted August 4, 2009 Hi, I would like to know if there is any way to kill the user processes (other than root or su processes) that are idle for more the 10 minutes. Any help would be greatly appreciated. Thanks, Prasad Quote Link to comment https://forums.phpfreaks.com/topic/168744-automatically-killing-the-idle-processes/ Share on other sites More sharing options...
trq Posted August 4, 2009 Share Posted August 4, 2009 You would grep ps finding said processes, then go from there. Quote Link to comment https://forums.phpfreaks.com/topic/168744-automatically-killing-the-idle-processes/#findComment-890337 Share on other sites More sharing options...
pjoshi Posted August 4, 2009 Author Share Posted August 4, 2009 Thorpe, I did not understand what you meant by grep ps to find the processes. Can you plz elaborate on this. This is very important for me. Prasad Quote Link to comment https://forums.phpfreaks.com/topic/168744-automatically-killing-the-idle-processes/#findComment-890418 Share on other sites More sharing options...
trq Posted August 4, 2009 Share Posted August 4, 2009 I haven't got time to write the script for you but can hopefully get you started. grep is a pattern matching program. ps is used to find information on currently running processes. You likely also need awk, which helps format strings 9amongst other things). Commands can be simply piped together in Linux (output of one command into the input of the next), this is how more complex commands are built. Actually, thinking about this, it might actually be easier to search through all users looking at there processes in turn. Brb. Quote Link to comment https://forums.phpfreaks.com/topic/168744-automatically-killing-the-idle-processes/#findComment-890431 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.