Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Question
Is it possible to read the output of a batch script so that the JobScheduler generates an error code?
For example, if the file I you want to copy does not exist or if it is not possible to make establish a connection to an SFTP Server because the target host cannot be reached.
Answer
There are several approaches to handling handle exit codes and file transfer. The exact preferred solution depends on whether the respective job in question is an order job or standalone job and whether a shell or API script is being executed.
- The simplest solution is to specify an exit code at the end of a shell script. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
exit 5 |
The handling of exit codes themselves is covered in two sections of our JobScheduler FAQs:
- Error handling and, to a lesser extent,
- Shell jobs: starting scripts
The example described given in the original question above concerned concerns situations wherewhen, for example, files to be transferred are were not available. This subject is covered seperately in:
...
Note that file transfer operations can often be conveniently carried out with our JADE application, and in particular with our JADE JITL template jobs that Jobs that are fully integrated into JobScheduler.