I wrote a script that scans a folder for new files.
I don't want to run it at specific times but only when the computer is NOT busy.
I tried to use nice but it doesn't really work. I mean, even if my process has less priority, it still slows down the other processes. I did a test to check that. The following command creates a dummy file of 256 MB: It lasts 20 seconds
If I run this command two times at the same time, one in normal mode, the other one with nice, I get the following times: normal=35 seconds
niced=45 seconds
What I'm trying to do is that one command runs without being slowed down and the other command simply waits untill it can run without slowing down other processes.
Am I clear enough? Don't hesitate to ask for more information if you can help me.
Matez,
I have a list of process id's in a text file. I want to know how to find the idle time of a process which are more than 300secs and kill them accordingly.
Could you please help me to get these details. I want to write a shell script with this.
Thanks..Krish :) (36 Replies)
We are running AIX 5.3 and for ICICS Printing we have process called cicstermp runing whcih attaches the print to print queue
But is process is triggered when ever a print is to be given
Can we find the processes which are idle
I mean every time a print is given it creats a new cicstermp... (1 Reply)
Dear Friends ,
I am using DB2 database in AIX 5.3 server . In my server some IDLE process are generated after several times which I need to kill it manually each and every time .
The process I query like following :
root@bagpuss $ ps auxw|sort -r +3|head -10
USER PID %CPU %MEM ... (3 Replies)
Hi Everybody,
Can anybody explain how CPU idle% is about 50%, but runq-sz more than 1?
sar from Solaris 10:
00:00:05 %usr %sys %wio %idle
17:00:08 27 12 0 61
17:20:05 40 15 0 45
17:40:05 27 12 0 61
18:00:05 23... (2 Replies)
Hi,
I need a script that can automatically kill all processes named "webrepn" and "webrebw" if idle for more than 30 minutes.
Then I will have a Cron Job to run the script every night or 2-3 times a day depends on how this script helps.
Right now, I run "ps -ef | grep webrebn" and "kill -9... (7 Replies)
I noticed when having some trouble with code I was testing that the CPU was becoming exhausted and I would have to reboot. After rebooting a couple times I decided to check for other problems before trying my code again. That's when I noticed that the CPU with the idle process was through the roof:... (5 Replies)
I would like to run a command if my computer is idle.
I found this, but is not quite working.
#!/bin/sh
idletime=$(xprintidle)
threshold=300000 # 5 min = 5 * 60 * 1000 ms
if ; then
echo "idle for 5 minutes."
fi (4 Replies)
Discussion started by: drew77
4 Replies
LEARN ABOUT OPENDARWIN
rtprio
RTPRIO(2) BSD System Calls Manual RTPRIO(2)NAME
rtprio -- examine or modify a process realtime or idle priority
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <sys/types.h>
#include <sys/rtprio.h>
int
rtprio(int function, pid_t pid, struct rtprio *rtp);
DESCRIPTION
The rtprio() system call is used to lookup or change the realtime or idle priority of a process.
The function argument specifies the operation to be performed. RTP_LOOKUP to lookup the current priority, and RTP_SET to set the priority.
The pid argument specifies the process to be used, 0 for the current process.
The *rtp argument is a pointer to a struct rtprio which is used to specify the priority and priority type. This structure has the following
form:
struct rtprio {
u_short type;
u_short prio;
};
The value of the type field may be RTP_PRIO_REALTIME for realtime priorities, RTP_PRIO_NORMAL for normal priorities, and RTP_PRIO_IDLE for
idle priorities. The priority specified by the prio field ranges between 0 and RTP_PRIO_MAX (usually 31). 0 is the highest possible prior-
ity.
Realtime and idle priority is inherited through fork() and exec().
A realtime process can only be preempted by a process of equal or higher priority, or by an interrupt; idle priority processes will run only
when no other real/normal priority process is runnable. Higher real/idle priority processes preempt lower real/idle priority processes.
Processes of equal real/idle priority are run round-robin.
RETURN VALUES
The rtprio() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate
the error.
ERRORS
The rtprio() system call will fail if
[EINVAL] The specified prio was out of range.
[EPERM] The calling process is not allowed to set the realtime priority. Only root is allowed to change the realtime priority of
any process, and non-root may only change the idle priority of the current process.
[ESRCH] The specified process was not found.
SEE ALSO nice(1), ps(1), rtprio(1), setpriority(2), nice(3), renice(8)AUTHORS
The original author was Henrik Vestergaard Draboel <hvd@terry.ping.dk>. This implementation in FreeBSD was substantially rewritten by David
Greenman.
BSD July 23, 1994 BSD