Jobs — define parameters for batch jobs
This directive configures Interchange batch jobs facility. For detailed discussion, please see the jobs glossary entry.
The directive accepts a list of key/value pair and can be specified at both global and catalog level.
The available keys for the global directive are:
Key | Default | Description |
---|---|---|
MaxLifetime
|
600
|
The maximum time in seconds that a job will be allowed to run |
MaxServers
|
1
|
The maximum number of servers processing jobs. Excess jobs will be queued |
UseGlobal
|
false
|
Always search for global job definitions? |
The available keys for the catalog directive are:
Key | Default | Description |
---|---|---|
add_session
|
false
|
Add session dump to job output? |
autoend
|
None | A macro to execute after each invidiual file in the job |
autoload
|
None | A macro to execute before each invidiual file in the job |
base_directory
|
etc/jobs
|
Directory to search for batch jobs. |
email
|
None | Email job output to this address |
extra_headers
|
None | Additional email headers |
from
|
MailOrderTo
|
"From" address in emails |
ignore_errors
|
false
|
Excludes fatal errors from job output |
filter
|
Filters applied to job output | |
initialize
|
None | A macro executed before the job commences |
log
|
None | Write job output to this logfile |
subject
|
Interchange results for job: %s
|
Subject for emails, including placeholder for job name |
suffix
|
None | Restrict job to files matching the specified suffix |
trackdb
|
None | Table for tracking jobs |
use_global
|
false
|
Search for global job definitions? |
For more information about Interchange batch jobs see jobs glossary entry.
Example: Define catalog-level Jobs directive
Jobs <<EOJ log logs/jobs.log base_directory jobs email root@myhost.mydomain.local EOJ
Example: Run jobs manually
Invoke from the command line:
su -c '/PATH/TO/interchange --quiet --runjobs=CATALOG_NAME=DIRECTORY_NAME' USERNAME
Example: Run jobs automatically from Unix crontab
12 2 * * * su -c '/PATH/TO/interchange --quiet --runjobs=CATALOG_NAME=DIRECTORY_NAME' USERNAME
Files in the jobs directory that end in HTMLsuffix
will be silently ignored.
The invocation of jobs from the command line will only queue them for execution and will return the shell prompt before the jobs have actually started executing.
In that case, a common temporary session (mv_tmp_session
== true)
will be created for use by all of the files
in the job queue. The session will be closed when the jobs complete.
The remote IP address will be set to none
and the
user agent string will be set to commandline
.
Interchange 5.9.0:
Source: lib/Vend/Config.pm
Line 3188 (context shows lines 3188-3205)
sub parse_hash { my($item,$settings) = @_; if (! $settings) { return $HashDefaultBlank{$item} ? '' : {}; } my $c; if(defined $C) { $c = $C->{$item} || {}; } else { no strict 'refs'; $c = ${"Global::$item"} || {}; } return hash_string($settings,$c); }