At, Batch ...
Reinhard Doelz
doelz at urz.unibas.ch
Fri Feb 3 21:19:00 AEST 1989
Congratulations... I already thought I were a lonsome guy and nobody wants
to run batch jobs on the iris.
The BATCH and AT commands are not reasonably documented. I tried to find
out what the queue definitions are by trial and error, and up to now
SGI did not offer any documentation on the queuedefs file.
b.2j2n90w means - (I believe) - the following:
b - the queue name. You may invent any new queue name you want and you
may submit jobs into these queues if you specify the -q qualifier
in the at command. CAUTION: There is a non-documented queue c (the
cron queue), and any attempt to redefine this causes seriuos OS problems.
2j - the maximum jobs permitted. If the job limit is reaced, the job is
rescheduled later (see below). Take care not to submit too many jobs
which are not running, otherwise your /usr/lib/cron/log file reaches
incredible dimensions !
2n - must be something with the nice (1) command. Values up to 19 are
permitted. I used a different approach (see below) for prioritizing.
90w - this is the time in seconds the OS waits until it tries to reschedule
the job. This is useful if you have log jobs running and it doesn't make
sense to resubmit the job every minute (which is the default if the
parameter is missing).
My approach to redefine batch job priorities is using the non-aging
priorities (see /usrinclude/sys/schedctl.h - thanks to SGI for giving
the hint to look there). I added the following lines to /usr/spool/cron
/crontabs/root :
#
# process prioritizing
15,30,45 6-22 * * * /usr/local/acct/prio_set.com
0 * * * * /usr/local/acct/prio_set.com
#
Then, I created a dirctory /usr/local/acct and put the following files there:
prio_set.com:
=============
ps -ef | awk -f /usr/local/acct/find_user.awk | awk -f
/usr/local/acct/put_user.awk > /tmp/prio.csh
csh /tmp/prio.csh
rm /tmp/prio.csh
find_user.awk:
==============
{
n = split ($7,ti,":")
if ($7 != "?" && $1 !="root")
print $2,ti[1],ti[2]
}
put_user.awk:
=============
{
if ($2 > 15 && $2 < 30 && $1 != "PID")
print "npri -h140 -p ",$1
if ($2 > 30 && $2 < 60 && $1 != "PID")
print "npri -h180 -p ",$1
if ($2 > 60 && $2 < 180 && $1 != "PID")
print "npri -h200 -p ",$1
if ($2 > 180 && $2 < 600 && $1 != "PID")
print "npri -h220 -p ",$1
if ($2 > 600 && $2 <2000 && $1 != "PID")
print "npri -h225 -p ",$1
if ($2 > 2000 && $1 != "PID")
print "npri -h230 -p ",$1
}
These commands make root check every 15 minutes whether a job is to be
reprioritized, and the priority gets worse (= higher) the longer the
job is in the system. The advantage of this is that your on-line jobs
(i.e. graphics - (NOT flight, listen, knobi?)) are not influenced by batch
jobs.
*** PROBLEM : ***
My problem with the cron is as follows:
If you look at the root crontab file, there is a command which makes
cron put its output in a new logfile :
#
# rotate the logs
1 1 * * 0 umask 033;cd /usr/lib/cron;mv -f log OLDlog;touch log; killall 1 cron
That's o.k. as long as the log file is concerned. But this new cron then
forgot all the jobs to be scheduled and there is no way to resubmit the jobs
which are still correctly placed in /usr/spool/cron/atjobs.
Is anyone out in netland familiar with this stuff ?
Comments, suggestions, *documentation*, etc welcome.
Reinhard
************************************************************************
* Dr. Reinhard Doelz * SWITZERLAND *
* Biocomputing * *
* Biozentrum * doelz%urz.unibas.ch at relay.cs.net *
* Klingelbergstrasse 70 * *
* CH-4056 Basel * *
************************************************************************
More information about the Comp.sys.sgi
mailing list