Thursday, March 22, 2012

Create a delay between FTP tasks, or?

Hi,

I have a package that will be using an FTP task to send a file (file1) to an ftp site.

Once the file (file1) is received at the ftp site, a corresponding file (file2) will be placed in the ftp directory, and then I will need to ftp the corresponding file (file2) back.

However, there will be a time delay between the time that file1 is received and file2 is put in the ftp directory. Maybe 5 to 30 minutes.

What is the best way to handle this scenario? I want to ftp file2 back as soon as it's available. However, I don't know when that is, and so I was wondering if there is a way to dynamically check for the availability of the file, so that I don't have to "hard code" a wait time into my process.

Thanks!

Setup a for loop to evaluate a variable such that as long as the variable is set to 0 the loop will happen. Then, using a script task, you can check to see if the file exists, and if not wait 5 seconds, or something like that. If it does, then set the for loop control variable to 1, which will allow it to exit and then execute another FTP task.|||Yes, that sounds reasonable. Do you have a sample of how one would write a script task to check for the availability of a file on a remote ftp site? I guess I could just use basic ftp commands, yes?|||This might help get your started. Does some slightly different stuff, but connectivity wise, it may get you going in the right direction.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1074276&SiteID=1|||

Hi,

Another suggestion, you can use the file system task editor with set attributes, if it is successful your file is back. You can loop through this, maybe use a thread.sleep in a script component.

Larry

|||

LarryETL wrote:

Hi,

Another suggestion, you can use the file system task editor with set attributes, if it is successful your file is back. You can loop through this, maybe use a thread.sleep in a script component.

Larry

He needs to check a remote FTP site though.

No comments:

Post a Comment