Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 01330ec25d
Fetching contributors…

Cannot retrieve contributors at this time

121 lines (110 sloc) 4.053 kB
__NAME__ purpose
define Interchange-aware crontab entries
__END__
__NAME__ synopsis
<arg choice='plain'>
<replaceable>seconds</replaceable>
</arg>
<arg choice='plain'>
<replaceable>minutes</replaceable>
</arg>
<arg choice='plain'>
<replaceable>hours</replaceable>
</arg>
<arg choice='plain'>
<replaceable>days</replaceable>
</arg>
<arg choice='plain'>
<replaceable>months</replaceable>
</arg>
<arg choice='plain'>
<replaceable>days_of_week</replaceable>
</arg>
<arg choice='plain'>
<replaceable>target</replaceable>
</arg>
__END__
__NAME__ description
&conf-__FILENAME__; is an &IC;-equivalent of the usual Unix "cron"
(periodic execution) facility.
</para><para>
Time specifications (first six fields) behave exactly like
with the traditional Vixie cron.
That includes numbers, ranges and '<literal>*</literal>';
see <citerefentry><refentrytitle>crontab</refentrytitle>
<manvolnum>5</manvolnum></citerefentry> manual page.
Additional features are provided by the <classname>Set::Crontab</classname>
&PERL; module:
The '<literal>&lt;<replaceable>N</replaceable></literal>' and
'<literal>&gt;<replaceable>N</replaceable></literal>' select
elements smaller and larger than <replaceable>N</replaceable>.
<literal>!<replaceable>N</replaceable></literal> excludes
<replaceable>N</replaceable> from the set. "<literal>!3</literal>"
with a range of "<literal>1-10</literal>" corresponds to
"<literal>1-2,4-10</literal>", and "<literal>>3,!7</literal>"
in the same range means "<literal>4-6,8-10</literal>".
</para><para>
Target specification, provided in form of everything after the 6th field,
consists of the catalog name and action. Catalog name can be prefixed
with <literal>&gt;</literal>, <literal>&lt;</literal> and
<literal>=</literal>.
Name prepended with '<literal>&gt;</literal>' will make the
commands run <emphasis role='bold'>after</emphasis> the
reconfig/restart/jobs/pid management cycle (usually they run before).
</para><para>
Interchange-specific things you can run include
everything you can put into execution over
<function>Vend::Dispatch::run_macro</function> function.
That means &conf-GlobalSub;s, &conf-Sub;s and anything
else that is suitable for interpolation (all &glos-ITL; code).
</para><para>
Bear in mind, though, that there is no catalog context; everything is
executing on the global level.
</para><para>
In addition to the above, two special targets exist,
<literal>:reconfig</literal> and <literal>:jobs</literal>.
They define the intervals for processing
catalog reconfiguration and batch job requests.
The <filename>reconfig</filename> and
<filename>jobsqueue</filename> files in &conf-RunDir; are ignored
if &conf-__FILENAME__; is specified and these targets not included.
In that case, a warning will be issued because, without the two
entries, catalog reconfiguration or job execution requests are
ignored &mdash; something you almost never want in regular operation.
__END__
__NAME__ example: Running :restart and :jobs every 5 minutes
The basic entry to implement <literal>HouseKeeping 300</literal>
would be:
<programlisting><![CDATA[
HouseKeeping 1 minute
HouseKeepingCron <<EOC
*/5 * * * * * :restart
*/5 * * * * * :jobs
EOC
]]></programlisting>
__END__
__NAME__ example: Running batch jobs
<programlisting><![CDATA[
HouseKeepingCron <<EOC
0 0 * * * * =standard hourly
0 1 2 * * * =standard daily
0 2 4 * * 7 =standard weekly
0 0 3 1 * * =standard monthly
EOC
]]></programlisting>
__END__
__NAME__ example: Warning message when :reconfig entry is not present
The warning message would look like this:
<programlisting>
WARNING: suggested cron entry ':reconfig' not present.
</programlisting>
__END__
__NAME__ see also
HouseKeeping, RunDir
__END__
__NAME__ missing
run_macro() also supports calling Interpolate::tag_profile if argument is \w+-\w+ but it's not documented ATM as I have no idea what to do with it
more about <>= in target specification
Last example (batch jobs) needs to be fixed (or clarified how it works?)
Clarify what the first 6 fields mean and adjust synopsis/description
__END__
Jump to Line
Something went wrong with that request. Please try again.