Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

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
languagebash
titleExample shell script exit function
 exit 5

The handling of exit codes themselves is covered in two sections of our JobScheduler FAQs:

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.