EldoS | Feel safer!

Software components for data protection, secure storage and transfer

SFTP Copy Before Receive

Also by EldoS: CallbackRegistry
A component to monitor and control Windows registry access and create virtual registry keys.
#19610
Posted: 03/28/2012 10:34:02
by Martin Kuberski (Basic support level)
Joined: 03/28/2012
Posts: 5

Hi everybody,

I am evaluating the new version of BizCrypto which supports the command "Before Receive".
However, I am not able to backup a message before BizTalk picks it up.

In the event viewer I get following error:
"EldoS SFTP Adapter: Error encountered when parsing commands script: Field "overwrite" does not exists."

The command I am using:
Code
<commands>
<command type="sftp" value="copyremotefile" source="/path/%SourceFileName%" dest="/path/pathBackup/%SourceFileName%.backup" />
</commands>


As shown on the "Customizing SFTP / FTPS" page for the copyremotefile-command there is no overwrite field/attribute supported.
URI: http://eldos.com/security/articles/7581.php

I've allready tried to add an overwrite attribute to the command by myself, but it throws me an error like :
"EldoS SFTP Adapter: Error: 'Operation unsupported' when executing command 'copyremotefile'"
In the configuration of the adapter I've also tried out to change the value from "overwrite" to Yes and No, but both doesn't work.

If I use the same command for the "On After Receive" propertiy, everythings works as it should. Biztalk picks the message up and copies the message to its backup directory. DELETE property is set to never.

Could someone be so kindly to lead me to the correct settings? We need that feature, otherwise it makes no sense for us to update the component.


Best regards,
Martin Kuberski
#19611
Posted: 03/28/2012 11:23:13
by Ken Ivanov (EldoS Corp.)

Thank you for contacting us.

First, I should apologise for the mistake in the how-to. The 'overwrite' parameter should be passed along with the 'source' and 'dest' parameters and should be set either to 'true' or to 'false'.

Quote
I've allready tried to add an overwrite attribute to the command by myself, but it throws me an error like :
"EldoS SFTP Adapter: Error: 'Operation unsupported' when executing command 'copyremotefile'"

This means that your server doesn't support remote file copying. It is normal actually - remote copy is only supported by SFTPv5-capable servers, and there are not too many of them available. What IS surprising is that you say that you've got the script working with On After Receive property. Could you please re-check that for us? I believe you are either using the 'renamefile' command (not 'copyremotefile') or are backing up the file with Safe Download Mode = After Get technique.

Generally, I wouldn't recommend that you rely on 'copyremotefile' command - as it is supported by too few SFTP servers worldwide. It makes sense to review your task to use 'renamefile' command instead. I believe we could arrange some replacement for SFTP-based remote file copying in BizCrypto 10, but this task is not that trivial and will take a couple of months to implement.
#19623
Posted: 03/29/2012 03:28:15
by Martin Kuberski (Basic support level)
Joined: 03/28/2012
Posts: 5

You're absolutely right, I've used the 'renamefile' command.

Nevertheless I don't get the adapter working to backup files before they get picked up. It's not that problem to 'rename' the files after receive, but that is not the target we want to achieve.

We want to be safe if something goes wrong during the transport process for example. Is it possible to backup/rename a file before it gets picked up?
Or is the only way to rename them 'after receive'?
#19625
Posted: 03/29/2012 04:20:07
by Martin Kuberski (Basic support level)
Joined: 03/28/2012
Posts: 5

Could you provide me the right syntax for the 'copyremotefile' command?

Where should i add the overwrite value?

Code
<commands><command type="sftp" value="copyremotefile" source="/path/%SourceFileName%" dest="/path/pathBackup/%SourceFileName%.backup" /></commands>
#19628
Posted: 03/29/2012 10:22:36
by Ken Ivanov (EldoS Corp.)

Quote
We want to be safe if something goes wrong during the transport process for example. Is it possible to backup/rename a file before it gets picked up?
Or is the only way to rename them 'after receive'?

Unfortunately, it is not possible to back up (meaning "copy") files before downloading them unless the SFTP server runs SFTPv5 or later version. As I said above, we will add the ability to copy files remotely over earlier SFTP versions in BizCrypto 10, yet, in any case you can't do that right now.

Besides renaming files after downloading them, you can also rename them before the transfer. This can be done either by passing the "renamefile" command to the On Before Receive property, or using the Safe Download feature.

I believe it makes sense to review your goal. In other words, what exactly problems do you expect to occur during the download? The files are opened in read-only mode, this way they can't be corrupted during the transfer. If the transfer fails for some reason, the adapter does not delete the file, unless you force it to do so.
#19629
Posted: 03/29/2012 10:23:40
by Ken Ivanov (EldoS Corp.)

You can add the overwrite value in the following way:

Code
<commands><command type="sftp" value="copyremotefile" source="/path/%SourceFileName%" dest="/path/pathBackup/%SourceFileName%.backup" overwrite="true" /></commands>
Also by EldoS: CallbackProcess
A component to control process creation and termination in Windows and .NET applications.

Reply

Statistics

Topic viewed 3011 times

Number of guests: 1, registered members: 0, in total hidden: 0




|

Back to top

As of July 15, 2016 EldoS Corporation will operate as a division of /n software inc. For more information, please read the announcement.

Got it!