SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Get new files and folders from FTP


Get new files and folders from FTP

Author
Message
hawk 68434
hawk 68434
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 127
I need to check an ftp site nightly for new folders containing image files and download just the files and folders and exclude folders that I don't need. There hundreds of folders and each folder containing from 5 to 10 image files. I have already done an initial download of all of the file that I need. There new files uploaded to the site on a regular basses. I just need those new files. Can any one help me with this?
Raunak Jhawar
Raunak Jhawar
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1655 Visits: 1944
There are several methods to achieve this:

Most basic:

have a file archive mechanism in place, once you have processed the file, move the file to an alternate location so that the source folder in FTP is always empty and every time you package will read only new files

Regards/Raunak
Now a member of Linkedin

Please visit the all new Performance Point Forum
Please visit the all new Data Mining and Business Analytics Forum
hawk 68434
hawk 68434
Forum Newbie
Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)Forum Newbie (2 reputation)

Group: General Forum Members
Points: 2 Visits: 127
Thanks Raunak,

I can't modify the source folder. I can only download the files.
Raunak Jhawar
Raunak Jhawar
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1655 Visits: 1944
What happens to the files which are already downloaded and processed? Can you describe the workflow? This will enable the folks to answer the problem

Regards/Raunak
Now a member of Linkedin

Please visit the all new Performance Point Forum
Please visit the all new Data Mining and Business Analytics Forum
Lowell
Lowell
One Orange Chip
One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)One Orange Chip (28K reputation)

Group: General Forum Members
Points: 28542 Visits: 39977
you have to keep track of the files already processed someplace. that's #1. do you have that accessible?

Like Raunak Jhawar suggested, you'd move the processed files someplace, like to an Archived\ folder, and delete them / move them from the FTP site.

otherwise you have to open the FTP connection, read the list of files(which gets tricky to script), and then you can compare all files vs already processed files; that list of already processed files could be either a list of all files in the archived folder, or in the database somehow;
so much of it depends on the existing process, i'm not sure i can offer much more advice than that.

all those steps sound like a whopper of a script task to me.

Lowell

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

a4apple
a4apple
SSC Veteran
SSC Veteran (262 reputation)SSC Veteran (262 reputation)SSC Veteran (262 reputation)SSC Veteran (262 reputation)SSC Veteran (262 reputation)SSC Veteran (262 reputation)SSC Veteran (262 reputation)SSC Veteran (262 reputation)

Group: General Forum Members
Points: 262 Visits: 406
As suggested above, if you can have the track of file every time you are saving to a table in the database (one simple Execute sql task can do), you can use that table to lookup if that image is present or not and then skip if it is present or move to the new folder if it isn't.

Good Luck Smile .. Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search