🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

3 total messages Started by M. D. Parker Mon, 19 Jun 1989 16:05
System V -- Information on /usr/lib/cron/.proto
#10
Author: M. D. Parker
Date: Mon, 19 Jun 1989 16:05
11 lines
899 bytes
In observing the operation of 'at', I have noticed that it places information
from the /usr/lib/cron/.proto file at the head of the job.  I would 
be interested in knowing what variables are passed for integration into
this file.  From what I see, there is $d for local directory, and $l for
limit.  How many other such variables are provided?  What are their names
and functions?

Thanks again for your help.

Mike Parker
Manager, Systems Administration
Re: System V -- /usr/lib/cron/.proto and batch
#11
Author: Mike Wescott
Date: Tue, 20 Jun 1989 14:11
222 lines
7145 bytes
In articles <255@chip.UUCP> and <256@chip.UUCP> mparker@chip.UUCP (M. D. Parker) writes:

> The MAN page for BATCH(1) and AT(1) lists information about both commands
> together.  The man page indicates that invoking the BATCH command will 
> wait to start a job "until system load permits".  

> Exactly what does this mean?  

This man page for /usr/lib/cron/queuedefs posted some time ago by Guy Harris
should answer that, a shar of it is at the end of the message.

> In observing the operation of 'at', I have noticed that it places information
> from the /usr/lib/cron/.proto file at the head of the job.  I would 
> be interested in knowing what variables are passed for integration into
> this file.  From what I see, there is $d for local directory, and $l for
> limit.  How many other such variables are provided?  What are their names
> and functions?

At(1) reads .proto and recognizes the following commands:

	$d - substitute current working directory
	$l - substitute ulimit
	$m - substitute umask
	$t - substitute time to run script (preceded by a colon)
		time is in decimal (seconds since the epoch)
	$< - read in at job (from stdin) with no subs performed


# This is a shell archive.  Remove anything before this line, then
# unpack it by saving it in a file and typing "sh file".  (Files
# unpacked will be owned by you and have default permissions.)
#
# This archive contains:
# queuedefs.4 queuedefs.4.nr

echo x - queuedefs.4
cat > "queuedefs.4" << '//E*O*F queuedefs.4//'
.TH QUEUEDEFS 4
.SH NAME
queuedefs \- at/batch/cron queue description file
.SH SYNOPSIS
.LP
.B /usr/lib/cron/queuedefs
.SH DESCRIPTION
The
.I queuedefs\^
file describes the characteristics of the queues managed by
.IR cron (1M).
Each non-comment line in this file describes one queue.
The format of the lines are as follows:
.RS
.LP
\f2q\f3.\f1[\f2njob\f3j\f1][\f2nice\f3n\f1][\f2nwait\f3w\f1]
.RE
.LP
The fields in this line are:
.RS
.TP
.I q\^
The name of the queue.
.B a
is the default queue for jobs started by
.IR at (1);
.B b
is the default queue for jobs started by
.IR batch (1);
.B c
is the default queue for jobs run from a
.B crontab
file.
.TP
.I njob\^
The maximum number of jobs that can be run simultaneously in that queue; if
more than
.I njob\^
jobs are ready to run, only the first
.I njob\^
jobs will be run, and the others will be run as jobs that are currently running
terminate.  The default value is 100.
.TP
.I nice\^
The
.IR nice (1)
value to give to all jobs in that queue that are not run with a user
.SM ID
of super-user.  The default value is 2.
.TP
.I nwait\^
The number of seconds to wait before rescheduling a job that was deferred
because more than
.I njob\^
jobs were running in that job's queue, or because more than 25 jobs were
running in all the queues.  The default value is 60.
.RE
.LP
Lines beginning with
.B #
are comments, and are ignored.
.SH EXAMPLE
.RS
.nf
.ft B
a.4j1n
b.2j2n90w
.RE
.fi
.ft R
.LP
This file specifies that the
.B a
queue, for
.I at\^
jobs, can have up to 4 jobs running simultaneously; those jobs will be run with
a
.I nice\^
value of 1.  As no
.I nwait\^
value was given, if a job cannot be run because too many other jobs are running
.I cron\^
will wait 60 seconds before trying again to run it.
The
.B b
queue, for
.I batch\^
jobs, can have up to 2 jobs running simultaneously; those jobs will be run with
a
.I nice\^
value of 2.  If a job cannot be run because too many other jobs are running,
.I cron\^
will wait 90 seconds before trying again to run it.
All other queues can have up to 100 jobs running simultaneously; they will be
run with a
.I nice\^
value of 2, and if a job cannot be run because too many other jobs are running
.I cron\^
will wait 60 seconds before trying again to run it.
.SH FILES
/usr/lib/cron/queuedefs
.SH "SEE ALSO"
cron(1M)
//E*O*F queuedefs.4//

echo x - queuedefs.4.nr
cat > "queuedefs.4.nr" << '//E*O*F queuedefs.4.nr//'



     QUEUEDEFS(4)	       UNIX System V		  QUEUEDEFS(4)



     NAME
	  queuedefs - at/batch/cron queue description file

     SYNOPSIS
	  /usr/lib/cron/queuedefs

     DESCRIPTION
	  The queuedefs file describes the characteristics of the
	  queues managed by cron(1M).  Each non-comment line in this
	  file describes one queue.  The format of the lines are as
	  follows:

	       q.[njobj][nicen][nwaitw]

	  The fields in this line are:

	       q    The name of the queue.  a is the default queue for
		    jobs started by at(1); b is the default queue for
		    jobs started by batch(1); c is the default queue
		    for jobs run from a crontab file.

	       njob The maximum number of jobs that can be run
		    simultaneously in that queue; if more than njob
		    jobs are ready to run, only the first njob jobs
		    will be run, and the others will be run as jobs
		    that are currently running terminate.  The default
		    value is 100.

	       nice The nice(1) value to give to all jobs in that
		    queue that are not run with a user ID of super-
		    user.  The default value is 2.

	       nwait
		    The number of seconds to wait before rescheduling
		    a job that was deferred because more than njob
		    jobs were running in that job's queue, or because
		    more than 25 jobs were running in all the queues.
		    The default value is 60.

	  Lines beginning with # are comments, and are ignored.

     EXAMPLE
	       a.4j1n
	       b.2j2n90w

	  This file specifies that the a queue, for at jobs, can have
	  up to 4 jobs running simultaneously; those jobs will be run
	  with a nice value of 1.  As no nwait value was given, if a
	  job cannot be run because too many other jobs are running
	  cron will wait 60 seconds before trying again to run it.
	  The b queue, for batch jobs, can have up to 2 jobs running
	  simultaneously; those jobs will be run with a nice value of
	  2.  If a job cannot be run because too many other jobs are
	  running, cron will wait 90 seconds before trying again to
	  run it.  All other queues can have up to 100 jobs running
	  simultaneously; they will be run with a nice value of 2, and
	  if a job cannot be run because too many other jobs are
	  running cron will wait 60 seconds before trying again to run
	  it.

     FILES
	  /usr/lib/cron/queuedefs

     SEE ALSO
	  cron(1M)
//E*O*F queuedefs.4.nr//

exit 0
-- 
	-Mike Wescott
	 mike.wescott@ncrcae.Columbia.NCR.COM
Re: System V -- Information on /usr/lib/cron/.proto
#12
Author: Larry Campbell
Date: Tue, 20 Jun 1989 22:17
332 lines
7668 bytes
Guy Harris posted the answer to this question last November.  Here it
is again:

From: guy@auspex.UUCP (Guy Harris)
Newsgroups: comp.bugs.sys5
Subject: S5 documentation has no man page for "at" ".proto" files
Message-ID: <430@auspex.UUCP>
Date: 10 Nov 88 23:08:35 GMT

...which is kind of rude of it.  Attached is a man page for the S5R3
version; not having S5R2 source on hand, I don't know whether it applies
to the S5R2 version in its entirety or not.

As for the "-q" flag for "at", well, it specifies to which queue the job
should be submitted.  The queue name is a single letter, 'a' through 'z'.

However, some queues have special meanings:

	queue "b" is the "batch" queue, and if you submit a job to
	that queue "at" will not look for a "time to run" argument
	and will tell "cron" to run the job now;

	queue "c" is a pseudo-queue for "cron" jobs, and I don't know
	what happens if you submit a job to that queue - the SunOS 4.0
	"at" won't let you do so, so it may well do Horrible Things if
	you can coax your "at" into letting you do so.

Queue "a" is the default queue.

.TH PROTO 4
.SH NAME
proto \- prototype job file for at
.SH SYNOPSIS
.LP
.B /usr/lib/cron/.proto
.LP
.BI /usr/lib/.proto. queue
.SH DESCRIPTION
.LP
When a job is submitted to
.IR at (1)
or
.IR batch (1),
the job is constructed as a shell script.  First, a prologue is
constructed, consisting of:
.IP \(bu 3
A header whether the job is an
.I at
job or a
.I batch
job (actually,
.I at
jobs submitted to all queues other than queue
.BR a ,
not just to the batch queue
.BR b ,
are listed as
.I batch
jobs); the header will be
.LP
.RS
.nf
.ft B
: at job
.ft R
.fi
.RE
.LP
for an
.I at
job, and
.LP
.RS
.nf
.ft B
: batch job
.ft R
.fi
.RE
.LP
for a
.I batch
job.
.IP \(bu
A set of Bourne shell commands to make the environment (see
.IR environ (5))
for the
.I at
job the same as the current environment;
.IP \(bu
A command to run the user's shell (as specified by the
.SB SHELL
environment variable) with the rest of the job file as input.
.LP
.I At
then reads a \*(lqprototype file,\*(rq and constructs the rest of the
job file from it.
.LP
Text from the prototype file is copied to the job file, except for
special \*(lqvariables\*(rq that are replaced by other text:
.RS
.TP
.B $d
is replaced by the current working directory
.PD 0
.TP
.B $l
is replaced by the current file size limit (see
.IR ulimit (2))
.TP
.B $m
is replaced by the current umask (see
.IR umask (2))
.TP
.B $t
is replaced by the time at which the job should be run, expressed as seconds
since January 1, 1970, 00:00 Greenwich Mean Time, preceded by a colon
.TP
.B $<
is replaced by text read by
.I at
from the standard input (that is, the commands provided to
.I at
to be run in the job)
.PD
.RE
.LP
If the job is submitted in queue
.IR queue ,
.I at
uses the file
.BI /usr/lib/cron/.proto. queue
as the prototype file if it exists, otherwise it will use the file
.BR /usr/lib/cron/.proto .
.SH EXAMPLES
The standard
.B .proto
file supplied is:
.LP
.RS
.nf
.ft B
#ident	"@(#)adm:.proto	1.2"
cd $d
ulimit $l
umask $m
$<
.ft R
.fi
.RE
.LP
which causes commands to change the current directory in the job to the
current directory at the time
.I at
was run, to change the file size limit in the job to the file size limit
at the time
.I at
was run, and to change the umask in the job to the umask at the time
.I at
was run, to be inserted before the commands in the job.
.SH FILES
.PD 0
.TP 20
.B /usr/lib/cron/.proto
.LP
.BI /usr/lib/cron/.proto. queue
.PD 
.SH "SEE ALSO"
.IR at (1)


From wjh12!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!auspex!guy Fri Nov 11 08:34:41 EST 1988
Article 152 of comp.bugs.sys5:
Path: redsox!wjh12!husc6!bloom-beacon!tut.cis.ohio-state.edu!mailrus!cornell!batcomputer!itsgw!steinmetz!uunet!auspex!guy
>From: guy@auspex.UUCP (Guy Harris)
Newsgroups: comp.bugs.sys5
Subject: Re: S5 documentation has no man page for "at" ".proto" files
Message-ID: <431@auspex.UUCP>
Date: 10 Nov 88 23:26:04 GMT
References: <430@auspex.UUCP>
Reply-To: guy@auspex.UUCP (Guy Harris)
Organization: Auspex Systems, Santa Clara
Lines: 142

Minor corrections to the previously-posted man page:

.TH PROTO 4
.SH NAME
proto \- prototype job file for at
.SH SYNOPSIS
.LP
.B /usr/lib/cron/.proto
.LP
.BI /usr/lib/cron/.proto. queue
.SH DESCRIPTION
.LP
When a job is submitted to
.IR at (1)
or
.IR batch (1),
the job is constructed as a shell script.  First, a prologue is
constructed, consisting of:
.IP \(bu 3
A header whether the job is an
.I at
job or a
.I batch
job (actually,
.I at
jobs submitted to all queues other than queue
.BR a ,
not just to the batch queue
.BR b ,
are listed as
.I batch
jobs); the header will be
.LP
.RS
.nf
.ft B
: at job
.ft R
.fi
.RE
.LP
for an
.I at
job, and
.LP
.RS
.nf
.ft B
: batch job
.ft R
.fi
.RE
.LP
for a
.I batch
job.
.IP \(bu
A set of Bourne shell commands to make the environment (see
.IR environ (5))
for the
.I at
job the same as the current environment;
.IP \(bu
A command to run the user's shell (as specified by the
.SM SHELL
environment variable) with the rest of the job file as input.
.LP
.I At
then reads a \*(lqprototype file,\*(rq and constructs the rest of the
job file from it.
.LP
Text from the prototype file is copied to the job file, except for
special \*(lqvariables\*(rq that are replaced by other text:
.RS
.TP
.B $d
is replaced by the current working directory
.PD 0
.TP
.B $l
is replaced by the current file size limit (see
.IR ulimit (2))
.TP
.B $m
is replaced by the current umask (see
.IR umask (2))
.TP
.B $t
is replaced by the time at which the job should be run, expressed as seconds
since January 1, 1970, 00:00 Greenwich Mean Time, preceded by a colon
.TP
.B $<
is replaced by text read by
.I at
from the standard input (that is, the commands provided to
.I at
to be run in the job)
.PD
.RE
.LP
If the job is submitted in queue
.IR queue ,
.I at
uses the file
.BI /usr/lib/cron/.proto. queue
as the prototype file if it exists, otherwise it will use the file
.BR /usr/lib/cron/.proto .
.SH EXAMPLES
The standard
.B .proto
file supplied is:
.LP
.RS
.nf
.ft B
#ident	"@(#)adm:.proto	1.2"
cd $d
ulimit $l
umask $m
$<
.ft R
.fi
.RE
.LP
which causes commands to change the current directory in the job to the
current directory at the time
.I at
was run, to change the file size limit in the job to the file size limit
at the time
.I at
was run, and to change the umask in the job to the umask at the time
.I at
was run, to be inserted before the commands in the job.
.SH FILES
.PD 0
.TP 20
.B /usr/lib/cron/.proto
.LP
.BI /usr/lib/cron/.proto. queue
.PD 
.SH "SEE ALSO"
.IR at (1)


-- 
Larry Campbell                          The Boston Software Works, Inc.
campbell@bsw.com                        120 Fulton Street
wjh12!redsox!campbell                   Boston, MA 02146
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads