Skip to end of metadata
Go to start of metadata

This Job has been deprecated

The JobSchedulerFTPReceive Job has been deprecated with the release of JobScheduler version 1.10.

We strongly recommend that users of the JobScheduler version 1.10 and newer use the JADE and JADE4DMZ JITL Jobs for their file transfer requirements. FEATURE AVAILABILITY STARTING FROM RELEASE 1.10

If you use the JobSchedulerFTPReceive job in a job chain, then you have often the situation that the successor job wants to know which files have been transferred successfully.
The documentation of the JobSchedulerFTPReceive.xml job describes that the job generates the parameter ftp_result_filenames and ftp_result_filepaths where the successfully transferred files are listed.

Unfortunately, this feature is buggy. Both parameters are always empty.

You can insert the JobSchedulerExistsFile job as first successor job into the job chain.

Job Chain: ftpReceive.job_chain.xml

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job_chain  orders_recoverable = "yes">
    <job_chain_node state       = "receive"
                      job         = "ftpReceive"
                      next_state  = "check"
                      error_state = "error"/>
    <job_chain_node   state       = "check"
                      job         = "checkSuccessFiles"
                      next_state  = "process"
                      error_state = "error"/>
    <job_chain_node   state       = "process"
                      job         = "processSuccessFiles"
                      next_state  = "success"
                      error_state = "error"/>
    <job_chain_node   state       = "success"/>
    <job_chain_node   state       = "error"/>

Job: ftpReceive.job.xml

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job order="yes" stop_on_error="no">
       <include file="jobs/[ JobSchedulerFTPReceive.xml]"/>
    <script language="java" java_class="sos.scheduler.ftp.JobSchedulerFTPReceive"/>

Job: checkSuccessFiles.job.xml

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job order="yes" stop_on_error="no">
       <include file="jobs/[ JobSchedulerExistsFile.xml]"/>
    <script language="java" java_class="sos.scheduler.file.JobSchedulerExistsFile"/>

Job: processSuccessFiles.job.xml

 <?xml version="1.0" encoding="ISO-8859-1"?>
 <job order="yes" stop_on_error="no">
    <script language="shell">
 # here you can do somethimg with the result set

Order: ftpReceive,test.order.xml

 <?xml version="1.0" encoding="ISO-8859-1"?>
       <!-- Parameter of the ftpReceive job -->
       <param   name="ftp_host"          value="ServerA"/>
       <param   name="ftp_port"          value="22"/>
       <param   name="ftp_protocol"      value="sftp"/>
       <param   name="ftp_user"          value="my_user"/>
       <param   name="ftp_password"      value="my_pass"/>
       <param   name="ssh_auth_method"   value="password"/>
       <param   name="ftp_remote_dir"    value="/ftp_out"/>
       <param   name="ftp_local_dir"     value="/home/my_user/ftp_in"/>
       <param   name="ftp_file_spec"     value=".*"/>
       <param   name="ftp_atomic_suffix" value="~"/>
       <!-- Parameter of the fileExists job -->
       <param   name="file"              value="/home/my_user/ftp_in"/>
       <param   name="file_spec"         value="[^~]$"/>


The parameter ftp_atomic_suffix is set with "~".

Only successfully transferred files are renamed at the target to its original filename without the "~" at the end.

The file_spec parameter of the check looks for all files without a "~" at the end.


Write a comment…