Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Get new files and folders from FTP Expand / Collapse
Author
Message
Posted Friday, April 11, 2014 6:00 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 11, 2014 10:47 AM
Points: 2, Visits: 12
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?
Post #1560838
Posted Tuesday, April 15, 2014 10:07 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 3:28 AM
Points: 1,044, Visits: 1,839
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
Post #1561960
Posted Tuesday, April 15, 2014 12:43 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, June 11, 2014 10:47 AM
Points: 2, Visits: 12
Thanks Raunak,

I can't modify the source folder. I can only download the files.
Post #1562017
Posted Tuesday, April 15, 2014 12:54 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Wednesday, June 18, 2014 3:28 AM
Points: 1,044, Visits: 1,839
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
Post #1562024
Posted Tuesday, April 15, 2014 2:40 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 4:31 PM
Points: 12,881, Visits: 31,815
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

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #1562051
Posted Tuesday, April 15, 2014 2:55 PM


SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Wednesday, May 7, 2014 10:09 AM
Points: 141, Visits: 313
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 :) .. Visit www.sqlsaga.com for more t-sql code snippets and BI related how to articles.
Post #1562053
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse