ajsrerun
- Organization of this page
Format
ajsrerun [-F service-name] [-B execution-registration-number] [{-t|-s|-n|-a|-w|-f|-p|-e}] [-h] [-c] [-R] [-E] [-T] [-N|-J] [-X {yes|no|auto}] job-name-or-jobnet-name-or-job-group-name...
Description
Re-executes a jobnet. (Upon re-execution specification, the jobnet is executed immediately.) You can place a jobnet or job in the hold state and re-execute it later.
Execution privileges
You must have any of the following JP1 privileges:
-
JP1_AJS_Admin privilege
-
JP1_AJS_Manager privilege
-
JP1_AJS_Operator privilege
-F service-name
Specify the name of the target scheduler service.
You can specify a character string of 1 to 30 bytes.
-B execution-registration-number
Specify the execution registration number of the jobnet you want to re-execute in the YYYYMMDDNNN format. The following gives the contents of YYYYMMDDNNN.
YYYY: Year of the date of execution
MM: Month of the date of execution
DD: Day of the date of execution
NNN: Execution registration sequence number for the date of execution
For details of the execution registration number, see 4.5.13 Methods of specifying generations when executing commands in the manual JP1/Automatic Job Management System 3 Overview.
-t
Re-executes the jobnet from the top.
You can also re-execute a jobnet which has ended normally or ended with warning.
You can specify this option only in the root jobnet.
-s
Re-executes the jobnet containing an abnormally ended job from the top.
You can specify this option only in the root jobnet.
-n
Re-executes the jobs from the next job of an abnormally ended one.
You can specify this option only in the root jobnet.
-a
Re-executes the jobs from an abnormally ended one.
You can specify this option only in the root jobnet.
-w
Re-executes a job ended with warning.
If the re-execution of a job which has ended with warning results in an abnormal end, you can further re-execute the job as a job ended with warning. (For example, job A has ended with warning and you re-execute the job (first re-execution). If job A terminates abnormally during the first re-execution, you can specify the -w option to further re-execute job A (second re-execution).
You can specify this option only in the root jobnet.
-f
Starts re-execution by first re-executing a specified jobnet or job.
-p
Re-executes a specified jobnet or job.
-e
Re-executes the jobnets or jobs from the next jobnet or job of a specified one.
You cannot specify this option for the root jobnet. You cannot specify this option with the -h option.
-h
Temporarily holds and then re-executes the target job or jobnet.
You cannot specify this option for jobnet connector. You cannot specify this option with the -e option.
-c
Re-executes an abnormal preceding job or jobnet after placing it in the "ended with warning" status.
-R
Re-executes all jobnets and jobs contained in the specified unit.
If you specify this option with the -E and/or -T options, the system re-executes jobnets and jobs according to the specification of each option.
-E
Re-executes a jobnet registered for execution.
-T
Re-executes the root jobnet.
-N
Starts re-execution by first re-executing a jobnet.
-J
Starts re-execution by first re-executing a job.
-X {yes|no|auto}
Specify whether to automatically select the current unit for operation from the units listed in a planning group. The units in the job group are not, however, automatically selected regardless of the specified value. You cannot omit a root jobnet name.
-
yes
Specify this to automatically select a target unit.
When specifying a unit name in the command, omit a root jobnet name in a planning group.
-
no
Specify this if you do not want to automatically select a target unit.
You must specify a unit for which the command will operate. You cannot omit a root jobnet name in a planning group.
-
auto
Whether a target unit will automatically be selected depends on how the unit name is specified.
-
If you want to automatically select a target unit
Specify a unit name without a root jobnet name in a planning group.
-
If you do not want to automatically select a target unit
Specify a unit name with a root jobnet name in a planning group. The command will operate for the specified unit only. However, if there is a unit having the same name as the path name specified without a root jobnet name in a planning group, a root jobnet name is assumed to be omitted so that a target unit will be selected automatically.
-
job-name-or-jobnet-name-or-job-group-name
Specify the name of the job or jobnet you want to re-execute. You can also specify a job, jobnet, or job group name with the -R, -E, or -T option.
You can specify a character string of 1 to 930 bytes.
You can specify more than one job, jobnet, or job group name. You cannot specify a manager job group name or manager jobnet name.
You can specify a logical host name or execution ID as a job, jobnet, or job group name. If you specify an execution ID, however, the -B option is disabled. For details about how to specify the execution ID, see 1.1 Command syntax.
Notes
-
Either of the following users can re-execute a jobnet:
-
A user granted the operation privilege when the units contained in the jobnet to be re-executed were defined or when their attributes were changed
-
A JP1 user mapped to the OS user who has Administrators or superuser privileges
Note, however, that if yes is set after changing the ADMACLIMIT environment setting parameter from its default, even a JP1 user who was mapped to an OS user who has Administrators or superuser privileges must have the operation privilege.
-
-
This command terminates abnormally if you execute it without a scheduler service running.
-
With the -f, -p, or -e option specified, this command terminates abnormally if:
-
The root jobnet is placed in the Being held or Waiting for the start time status.
-
The nest jobnet or job is placed in any of the following statuses: Now running, Now rerunning, Being held, Waiting for the start time, Waiting for previous to end, Now queuing, or Waiting to execute.
-
-
If you re-execute a jobnet or a job during the execution of the jobnet by specifying the -f or -e option when the re-execution start point is before the job being executed, the job being executed is executed twice.
-
This command terminates abnormally if the target job is a judgment job.
-
If the job that is to be re-executed is a dependent job and no is set for the RERUNSUBORDINATE environment setting parameter, this command ends abnormally. For details about the RERUNSUBORDINATE environment setting parameter, see 20.4.2(109) RERUNSUBORDINATE in the JP1/Automatic Job Management System 3 Configuration Guide.
-
You cannot use this command for units subordinate to remote jobnets.
-
This command terminates abnormally if the target jobnet or job is being suspended.
-
When you specify that a target unit automatically be selected from the units in a planning group, an error occurs if you do not have the appropriate operation privilege for the automatically selected unit.
-
When the -X option is omitted, a target unit in a planning group is determined according to the value specified for the AJSAUTOJUDGE environment variable.
-
For an explanation of how to specify the name of a unit in a planning group, see Additional information in ajsplan in 3. Commands Used for Normal Operations.
-
If you specify none of the -t, -s, -n, -w, -f, -p, and -e options, the -a option is assumed.
-
When you specify the -s, -n, and -a options, the following states are treated as abnormal end states:
-
Ended abnormally (abnormal)
-
Not executed + Ended (unexec)
-
Interrupted
-
Killed
-
Invalid exe. seq.
-
Failed to start (fail)
-
Unknown end status (unknown)
-
Skipped, so not executed (skipped so not exe)
-
-
When monitoring of start conditions ends and the status changes from Now monitoring to any of the following, the status of the units in the root jobnet changes to Not execute + Ended:
-
Unmonitored + Ended
-
Monitor terminated
-
Monitor-end normal
The Not execute + Ended status is treated as abnormal termination. Keep this in mind when you re-execute a generation in any of the above statuses.
-
-
Care must be taken when a root jobnet or preceding unit is re-executed as a result of a judgment job. For details, see 2.4.3 Dynamically changing a process depending on the result of a preceding job (example of defining a jobnet that uses a judgment job) in the JP1/Automatic Job Management System 3 System Design (Work Tasks) Guide.
Return values
0 |
Normal end |
Multiple of 4 within the range from 4 to 124 |
Abnormal end |
Additional information
If you attempt to re-execute a jobnet which ended on or before the previous day, schedule information for the previous execution is applied to this re-execution. The following gives an example of the re-execution.
- Example:
-
Jobnet A that is executed every day and jobnet B that is executed only on Friday are operated as one jobnet X.
Because jobnet A ended abnormally on Thursday, however, this jobnet is re-executed on Friday.
In this example, only jobnet A is executed on Friday. As definition information for the previous execution (on Thursday) applies to the re-execution, jobnet B scheduled to be executed only on Friday is not executed.
Example
The following command re-executes the jobnet (net1) interrupted by the ajsintrpt command from the top.
ajsrerun -t net1