Antoni,
You can implement this logic using the SSIS framework. Here is one of
the ways you can implement this:
1. Insert SFTP Task with 'Get remote files list' action. Store the
result in package variable.
2. Insert 'foreach loop' and use the variable from step 1.
3. Insert 'for loop' in the 'foreach loop'. Setup an expression
controlling the loop to be dependent on variable. The variable will be
modified with a script.
4. Insert SFTP Task in the 'for loop' and setup the source to be
variable. The variable you have to use is the current 'foreach loop'
iteration variable.
5. Connect the SFTP Task on step 4 with success constraint to a script
task. The script task has to modify the variable used in the 'for
loop' from step 3 to break from the loop.
6. Connect the SFTP Task on step 4 with failure constraint to a script
task. In the script task implement the following logic:
- read a variable containing failure counter
- check if counter has reached the maximum.
- if not, increment it and store in the variable. The 'for loop'
from step 3 will continue to execute.
- if the counter has reached the maximum, store in some variable
there is a failure (maximum retries have been reached) and break from
the loop by modifying the variable used in step 3.
7. Insert script task or expression after the 'for loop' from step 3.
Use the success/failure variable to decide if you have to fail the
package or continue executing the package.
---
This is a rough description how you can implement a custom logic for
retrying to transfer a file up to a specific limit.