January 15, 2017 at 11:00 am
Hi,
I have to develop an FTP task that moves files from an FTP server that are older than a month to a department share folder path. What is the best way to accomplish this?
Thanks.
January 15, 2017 at 11:12 am
If the FTP server is in the same domain as the archive server that the department share lives on, then a DOS (ROBOCOPY likely the best) or PowerShell command would do the trick.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 15, 2017 at 7:14 pm
Jeff Moden - Sunday, January 15, 2017 11:12 AMIf the FTP server is in the same domain as the archive server that the department share lives on, then a DOS (ROBOCOPY likely the best) or PowerShell command would do the trick.
Thanks for the reply.
The FTP server is not in the same domain.
You mentioned ROBOCOPY, but this task needs to be carried out in SSIS. I actually should of mentioned that in my title description,my bad.
January 15, 2017 at 10:29 pm
Briceston - Sunday, January 15, 2017 7:14 PMJeff Moden - Sunday, January 15, 2017 11:12 AMIf the FTP server is in the same domain as the archive server that the department share lives on, then a DOS (ROBOCOPY likely the best) or PowerShell command would do the trick.Thanks for the reply.
The FTP server is not in the same domain.
You mentioned ROBOCOPY, but this task needs to be carried out in SSIS. I actually should of mentioned that in my title description,my bad.
I'm with Jeff on this - I'd use DOS to connect to the FTP server and copy the files to the network share. If you also have to delete them from the FTP server, I've found it useful to ensure the files are copied to the network share before deleting them from the FTP server. It prevents the deletion of a file that might not have downloaded correctly. The DOS and FTP scripts should be able to handle everything.
If you need to do it in SSIS, then I'm not the guy to help you.
January 16, 2017 at 4:38 am
Ed Wagner - Sunday, January 15, 2017 10:29 PMBriceston - Sunday, January 15, 2017 7:14 PMJeff Moden - Sunday, January 15, 2017 11:12 AMIf the FTP server is in the same domain as the archive server that the department share lives on, then a DOS (ROBOCOPY likely the best) or PowerShell command would do the trick.Thanks for the reply.
The FTP server is not in the same domain.
You mentioned ROBOCOPY, but this task needs to be carried out in SSIS. I actually should of mentioned that in my title description,my bad.
I'm with Jeff on this - I'd use DOS to connect to the FTP server and copy the files to the network share. If you also have to delete them from the FTP server, I've found it useful to ensure the files are copied to the network share before deleting them from the FTP server. It prevents the deletion of a file that might not have downloaded correctly. The DOS and FTP scripts should be able to handle everything.
If you need to do it in SSIS, then I'm not the guy to help you.
Thanks for chiming in. My FTP download process needs to automated, so SSIS would be the best route for me.
January 16, 2017 at 4:52 am
SSIS comes with an FTP task by default, however, you don't have much functionality with it (you can't check all the files on the server and get their age for example). You'll likely need to do this in a couple of steps, if SSIS is the solution you want to take.
Firstly, you'd connect the server via a script task and create a list of all the relevant files. I've found a script someone has written here to connect and get a list, but it'll need a little more work to fit your needs. I don't have any expertise in writing C# though, so I don't know what the code to achieve it would be, but you'd need to adapt it to check the age of the file and not add "new" files to your list.
You'll then need to create a foreach loop container, which firstly downloads the file to your archive location, and secondly deletes the file on the server after it has been downloaded.
Sorry I can't give you much more than that, but that should get you on the right path at least.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
January 17, 2017 at 11:06 pm
Thom A - Monday, January 16, 2017 4:52 AMSSIS comes with an FTP task by default, however, you don't have much functionality with it (you can't check all the files on the server and get their age for example). You'll likely need to do this in a couple of steps, if SSIS is the solution you want to take.Firstly, you'd connect the server via a script task and create a list of all the relevant files. I've found a script someone has written here to connect and get a list, but it'll need a little more work to fit your needs. I don't have any expertise in writing C# though, so I what the code you would need, but you'd need to adapt it to check the age of the file and not add "new" files to your list.
You'll then need to create a foreach loop container, which firstly downloads the file to your archive location, and secondly deletes the file on the server after it has been downloaded.
Sorry i can't give you much more than that, but that should get you on the right path at least.
Thank you. This is a good starting point for me. I think the script task would probably be the most challenging part for me since I have never used it.
The "here" link is not working.
January 18, 2017 at 1:53 am
Briceston - Tuesday, January 17, 2017 11:06 PMThank you. This is a good starting point for me. I think the script task would probably be the most challenging part for me since I have never used it.The "here" link is not working.
Try it now.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
January 19, 2017 at 7:59 am
Briceston - Monday, January 16, 2017 4:38 AMEd Wagner - Sunday, January 15, 2017 10:29 PMBriceston - Sunday, January 15, 2017 7:14 PMJeff Moden - Sunday, January 15, 2017 11:12 AMIf the FTP server is in the same domain as the archive server that the department share lives on, then a DOS (ROBOCOPY likely the best) or PowerShell command would do the trick.Thanks for the reply.
The FTP server is not in the same domain.
You mentioned ROBOCOPY, but this task needs to be carried out in SSIS. I actually should of mentioned that in my title description,my bad.
I'm with Jeff on this - I'd use DOS to connect to the FTP server and copy the files to the network share. If you also have to delete them from the FTP server, I've found it useful to ensure the files are copied to the network share before deleting them from the FTP server. It prevents the deletion of a file that might not have downloaded correctly. The DOS and FTP scripts should be able to handle everything.
If you need to do it in SSIS, then I'm not the guy to help you.
Thanks for chiming in. My FTP download process needs to automated, so SSIS would be the best route for me.
We use PowerShell or Batch commands to do our file moves. You set up a task in Windows Scheduler to automate them.
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply