Is it possible to run a custom shell command before download a file using BizCrypto SFTP Receive Location? For example to check somehow if the file is ready for processing?
Alternatively it would be great to test if the file is locked on the server.

I was wondering if I could use the SSH adapter to run a command on the server, but I am not sure how to do it. Is there any suggeston?

Out-of-the-box SFTP adapter does not support this (SSH shell is not opened at all when SFTP is used).

Current revision of the adapter stops and returns an error if it is unable to download one of the server-side files (if it is locked, for instance). We plan to update this behavior in one of the future BizCrypto builds, so that locked files would not affect download of other files. I assume, this will be a suitable resolution for your problem?

Quote

I was wondering if I could use the SSH adapter to run a command on the server, but I am not sure how to do it. Is there any suggeston?

Yes, running commands on server is the main purpose of the SSH adapter. The command to run can be set via the Command property of the adapter.

Thanks for the reply. I need a solution which is able to detect if the writing operation has been finished on the extract file (the file is not locked during the full writing process, sometime releases the file). If I used the SSH adapter to detect the writing finished, how can I parse the result of the command? What is the schema I will receive back? How should I configure the SSH adapter? e.g. process the stdout? Can you send me a sample, or some hint?

If the file is not locked during writing, how would you guess whether the writing has finished?

One of the possible solutions would be to delegate this task to a server-side application, which will check if the file is ready. If implementation of such application is under your control, the easiest thing would be to make this application block until the file is ready for download. The SSH adapter executing this application, in turn, will also block waiting for the command to return. Once the SSH adapter passes the execution flow to the next element of the orchestration, you can be confident that the file is OK.

Thank you for the details. It appears that the issue really does exist in 7.2.171 build. We can propose you the following workaround for it:

1) With the use of BizTalk administration console, assign some "dummy" command to the Command property of the adapter (e.g. "ls" or "time", whichever is available and not expensive for your server system). This is the command that would be executed twice.

2) Supply the appropriate command as a message to the input of the adapter. The message would have the following format (assuming that the right command is "/bin/do-the-job"):

Any updates on this? I would like to be able to be able to kick off an SSH command whenever a certain receive port needs a file... If I have to generate an xml message file then I think I'll need to create an orchestration which I was trying to avoid. I'd much rather have a pure messaging solution.

Sorry for disappointing you, but this task cannot be accomplished without involving an orchestration with currently available BizCrypto version. We actually do have the plans of extending SFTP and FTPS adapters with custom command execution, but I cannot say for sure when it will be available.

BTW, what would be the most convenient way for you to get the output of such command (or your task does not require an output)?

We use cookies to help provide you with the best possible online experience. By using this site, you agree that we may store and access cookies on your device. You can find out more about and set your own preferences here.