Skip to Content

Adding to the following Blogs this would cater another use case of the OS command.

The specified item was not found.

Executing Unix shell script using Operating System Command in XI

The specified item was not found.

 

Until the time I answered this Need a clarification in File to File scenario… in the forum truly I only had a theoretical view of the OS command rather practicing it. A week later a mail from my colleague knocked my mailbox addressing a requirement to delete file and also to send mails using the Unix script.  This aspired me to try out the OS Command scenario and the outcome of it is this Blog.

 

The requirement in curtail edition is to delete the inbound file only after the outbound files is posted successfully. The requirment is very genuine and wonder why this cant be made as an inbuilt functionality.

 

The approach to this is as follows.

 

  1. Archieve the inbound file.
  2. Use the same file name both in case of sender and receiver.
  3. Execute the Unix Script to delete the archived files only after the successful execution.

 

Configuration Steps:

 

1. In the Sender file adapter set the Processing Mode as Archieve and specify the path. Also enable the Adapter-Specific Message Attributes.

 

Sender Adapter

 

2. In the Receiver file adapter give the exact path of the Unix script in the option Run Operating System Command After Message Processing. Pass the filename as a command line argument to the script using the parameter %f.

 

Receiver File adapter

 

3. Use this Script to delete the Files from the Archive Directory.

You can even make an mail notification by adding the following Shell Script.

Output Mail:

Mail

This mail brought Grin in grinmy face.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

  1. Manojkumar Benake
    During the migration process problems have been reported for this blog. The blog content may look corrupt due to not supported HTML code on this platform. Please adjust the blog content manually before moving it to an official community.
    (0) 
  2. Ashutosh R
    Hi

    OS level script executing functionality is feasible only with NFS,  if possible we could do it for FTP also…

    Regards
    AshutoshR

    (0) 
  3. Suddhasatta Guha
    A nice blog! Added another useful tool to the inventory. Though I am a bitconfused about a basic concept. OS command works fine for NFS, but for FTP what is the use of executing OS command on the local system, rather we would want to prefer to have some control over the FTP server itself.
    Could you please throw some light on this?

    Regards,
    Suddha

    (0) 
    1. Matias Denker
      Hi !. You’re right. For OS command for FTP, we use a  unix script located in the XI filesystem, that opens a FTP connection to the destination system using the “ftp” command. Obviosly it’s not as good as a comm channel regarding log and tracking, but it is an option sometimes. Regards, Matias.
      (0) 
  4. Krishnakumar Ramamoorthy
    I would write an adapter module instead of OS command/Unix script because with OS command, there is no error handling or auditing. If there is a transient error in the delete, the same could be restarted from the run time workbench which is not possible with OS commands. I will have reservations using this approach in a production scenario, but that’s just me.
    KK
    (0) 

Leave a Reply