White space fix only. Translators can ignore.

Sponsored by:	iXsystems
This commit is contained in:
Dru Lavigne 2014-05-05 20:28:46 +00:00
parent 1f1d8dbccb
commit 4e8e3f8b52
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=44767

View file

@ -232,30 +232,29 @@ run_rc_command "$1"</programlisting>
<secondary>configuration</secondary>
</indexterm>
<para>One of the most useful utilities in &os; is <application>cron</application>.
This utility runs in the background and regularly checks
<para>One of the most useful utilities in &os; is
<application>cron</application>. This utility runs in the
background and regularly checks
<filename>/etc/crontab</filename> for tasks to execute and
searches <filename>/var/cron/tabs</filename> for custom
crontab files. These files are used to schedule
tasks which <application>cron</application> runs at the
specified times. Each entry in a crontab defines a task to run
and is known as a <firstterm>cron job</firstterm>.</para>
searches <filename>/var/cron/tabs</filename> for custom crontab
files. These files are used to schedule tasks which
<application>cron</application> runs at the specified times.
Each entry in a crontab defines a task to run and is known as a
<firstterm>cron job</firstterm>.</para>
<para>Two different types of configuration files are used:
the system crontab, which should not be modified, and user
crontabs, which can be created and edited as needed. The format
used by these files is documented in &man.crontab.5;. The
format of the system crontab, <filename>/etc/crontab</filename>
includes a <literal>who</literal> column which does not exist in
user crontabs. In the system crontab,
<application>cron</application> runs the command as
the user specified in this column. In a user
crontab, all commands run as the user who
created the crontab.</para>
<para>Two different types of configuration files are used: the
system crontab, which should not be modified, and user crontabs,
which can be created and edited as needed. The format used by
these files is documented in &man.crontab.5;. The format of the
system crontab, <filename>/etc/crontab</filename> includes a
<literal>who</literal> column which does not exist in user
crontabs. In the system crontab,
<application>cron</application> runs the command as the user
specified in this column. In a user crontab, all commands run
as the user who created the crontab.</para>
<para>User crontabs allow
individual users to schedule their own tasks. The <systemitem
class="username">root</systemitem> user
<para>User crontabs allow individual users to schedule their own
tasks. The <systemitem class="username">root</systemitem> user
can also have a user <filename>crontab</filename> which can be
used to schedule tasks that do not exist in the system
<filename>crontab</filename>.</para>
@ -276,13 +275,12 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin <co xml:id="co-env"/>
<calloutlist>
<callout arearefs="co-comments">
<para>Lines that begin
with the <literal>#</literal> character are comments. A
comment can be placed in the file as a reminder of what and
why a desired action is performed. Comments cannot be on
the same line as a command or else they will be interpreted
as part of the command; they must be on a new line. Blank
lines are ignored.</para>
<para>Lines that begin with the <literal>#</literal> character
are comments. A comment can be placed in the file as a
reminder of what and why a desired action is performed.
Comments cannot be on the same line as a command or else
they will be interpreted as part of the command; they must
be on a new line. Blank lines are ignored.</para>
</callout>
<callout arearefs="co-env">
@ -290,45 +288,43 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin <co xml:id="co-env"/>
define any environment settings. In this example, it is
used to define the <envar>SHELL</envar> and
<envar>PATH</envar>. If the <envar>SHELL</envar> is
omitted, <application>cron</application> will use the default Bourne shell.
If the <envar>PATH</envar> is omitted, the full path must be given to the
command or script to run.</para>
omitted, <application>cron</application> will use the
default Bourne shell. If the <envar>PATH</envar> is
omitted, the full path must be given to the command or
script to run.</para>
</callout>
<callout arearefs="co-field-descr">
<para>This line defines the seven fields used in a system crontab:
<literal>minute</literal>,
<literal>hour</literal>, <literal>mday</literal>,
<literal>month</literal>, <literal>wday</literal>,
<literal>who</literal>, and <literal>command</literal>.
The
<literal>minute</literal> field is the time in minutes when the
specified command will be run, the <literal>hour</literal> is
the hour when the specified command will be run, the
<literal>mday</literal> is the day of the month,
<literal>month</literal> is the month, and
<literal>wday</literal> is the day of the week.
<para>This line defines the seven fields used in a system
crontab: <literal>minute</literal>, <literal>hour</literal>,
<literal>mday</literal>, <literal>month</literal>,
<literal>wday</literal>, <literal>who</literal>, and
<literal>command</literal>. The <literal>minute</literal>
field is the time in minutes when the specified command will
be run, the <literal>hour</literal> is the hour when the
specified command will be run, the <literal>mday</literal>
is the day of the month, <literal>month</literal> is the
month, and <literal>wday</literal> is the day of the week.
These fields must be numeric values, representing the
twenty-four hour clock, or a <literal>*</literal>,
representing all values for that field. The
<literal>who</literal> field only exists in the system
crontab and specifies which user the command
should be run as. The last field is the command to be
executed.</para>
crontab and specifies which user the command should be run
as. The last field is the command to be executed.</para>
</callout>
<callout arearefs="co-main">
<para>This entry defines the values for this cron job.
The <literal>*/5</literal>, followed
by several more <literal>*</literal> characters, specifies that
<para>This entry defines the values for this cron job. The
<literal>*/5</literal>, followed by several more
<literal>*</literal> characters, specifies that
<command>/usr/libexec/atrun</command> is invoked by
<systemitem class="username">root</systemitem> every five
minutes of every hour, of every day and day of the week, of
every month.</para>
<para>Commands can include any number of switches.
However, commands which extend to multiple lines need to be
broken with the backslash <quote>\</quote> continuation
<para>Commands can include any number of switches. However,
commands which extend to multiple lines need to be broken
with the backslash <quote>\</quote> continuation
character.</para>
</callout>
</calloutlist>
@ -346,30 +342,30 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin <co xml:id="co-env"/>
an empty file. Once a user creates a crontab, this command
will open that file for editing.</para>
<para>It is useful to add these lines to the top of the crontab
file in order to set the environment variables and to remember
the meanings of the fields in the crontab:</para>
<programlisting>SHELL=/bin/sh
<para>It is useful to add these lines to the top of the crontab
file in order to set the environment variables and to remember
the meanings of the fields in the crontab:</para>
<programlisting>SHELL=/bin/sh
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
# Order of crontab fields
# minute hour mday month wday command</programlisting>
<para>Then add a line for each command or script to run,
specifying the time to run the command. This example runs the
specified custom Bourne shell script every day at two in the
afternoon. Since the path to the script is not specified in
<literal>PATH</literal>, the full path to the script is
given:</para>
<programlisting>0 14 * * * /usr/home/dru/bin/mycustomscript.sh</programlisting>
<para>Then add a line for each command or script to run,
specifying the time to run the command. This example runs the
specified custom Bourne shell script every day at two in the
afternoon. Since the path to the script is not specified in
<literal>PATH</literal>, the full path to the script is
given:</para>
<tip>
<para>Before using a custom script, make sure it is executable
and test that it works as intended from the command line.
This is especially important if the script includes any
commands that deletes files using wildcards.</para>
</tip>
<programlisting>0 14 * * * /usr/home/dru/bin/mycustomscript.sh</programlisting>
<tip>
<para>Before using a custom script, make sure it is executable
and test that it works as intended from the command line.
This is especially important if the script includes any
commands that deletes files using wildcards.</para>
</tip>
<para>When finished editing the crontab, save the file. It
will automatically be installed and
@ -381,10 +377,9 @@ PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
0 14 * * * /usr/home/dru/bin/mycustomscript.sh</screen>
<para>To remove all of the cron jobs in a user crontab:</para>
<screen>&prompt.user; <userinput>crontab -l</userinput>
remove crontab for dru? <userinput>y</userinput></screen>
</sect2>
</sect1>
@ -654,14 +649,14 @@ ifconfig_fxp0="inet 10.1.1.1/8"</programlisting>
information about the supported hardware and any known
limitations of the driver.</para>
<para>The drivers for common <acronym>NIC</acronym>s are
already present in the <filename>GENERIC</filename> kernel,
meaning the <acronym>NIC</acronym> should be probed during boot.
The system's boot messages can be viewed by typing
<para>The drivers for common <acronym>NIC</acronym>s are already
present in the <filename>GENERIC</filename> kernel, meaning
the <acronym>NIC</acronym> should be probed during boot. The
system's boot messages can be viewed by typing
<command>more /var/run/dmesg.boot</command> and using the
spacebar to scroll through the text. In this example, two
Ethernet <acronym>NIC</acronym>s using the
&man.dc.4; driver are present on the system:</para>
Ethernet <acronym>NIC</acronym>s using the &man.dc.4; driver
are present on the system:</para>
<screen>dc0: &lt;82c169 PNIC 10/100BaseTX&gt; port 0xa000-0xa0ff mem 0xd3800000-0xd38
000ff irq 15 at device 11.0 on pci0