Page 1 of 1

FTP to second FTP server on Failure

Posted: Wed Dec 07, 2011 1:59 pm
by crofte
Can you create a project to FTP a file to a remote server, and if the project fails for any reason, (after a few retries) FTP to another FTP server

Re: FTP to second FTP server on Failure

Posted: Fri Dec 09, 2011 5:30 pm
by RElliott63
This could be easily done by either calling separate modules or reading a Spreadsheet or Database Table for your IP addresses:

Pseudo code for Calling separate modules (assuming you only have 2 IP Addresses):
Code: Select all
<Module Main <dependsOn=FTPMain,FTPAlternate>
   ...Print Success Message (If ftpError eq 0)
   ...Email Notification (If ftpError gt 0)
</Module>

<Module FTPMain>
   <setVariable label="Set ftpError" version="1.0" name="ftpError" value="0" />
   <FTP ResourceID=<1st IP Address> ..... onError="setVariable:ftpError=1">
   ...
   ...Do something if ftpError=0...
</Module>

<Module FTPAlternate executeOnlyIf="${ftpError} gt 0>
   <setVariable label="Set ftpError" version="1.0" name="ftpError" value="0" />
   <FTP ResourceID=<1st IP Address> ..... onError="setVariable:ftpError=1">
   ...
   ...Do something if ftpError=0...
</Module>
The Pseudo Code for reading the IP Addresses from a Spreadsheet or Database would entail your use of multiple projects.. using a callProject within a loop reading the records. If you need help with this, please let me know... I have some examples.

Hope this helps...

-Rick