Scripting in SSIS

Advertisement

ravensensei
Joined:
Posts:
1
Location:
White Plains NY

Scripting in SSIS

I am writing a task in SSIS to use WinSCP to grab some files from an SFTP site.
cd Scorecard
option transfer binary
get *.* e:\SSISImports\
mv *.txt backup/*
close
exit    

Works great, downloads all of the files into the e:\SSISImports directory and moves the files on the remote side to a directory called backup. I'd like to do a few other things, but I'm unsure how.

1) Possibly modify my script to look for the file with the timestamp of yesterday. The client I'm working with created a file called download033009.txt with the latter numbers changing based on the day it was created. Since my job runs at 3am, I'd like to look for yesterdays file and if it isn't there, alert someone using SSIS task.

2) If the file I am trying to download has a timestamp that is later than the one I have locally, is there anyway to overwrite the local file?

thanks!
M@

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,253
Location:
Prague, Czechia

Re: Scripting in SSIS

ravensensei wrote:

1) Possibly modify my script to look for the file with the timestamp of yesterday. The client I'm working with created a file called download033009.txt with the latter numbers changing based on the day it was created. Since my job runs at 3am, I'd like to look for yesterdays file and if it isn't there, alert someone using SSIS task.
See some examples of similar scripts.

2) If the file I am trying to download has a timestamp that is later than the one I have locally, is there anyway to overwrite the local file?
It should be done automatically. Of course you should disable overwrite confirmations. See documentation. Or maybe you are looking for "synchronize local".

Reply with quote

Advertisement

You can post new topics in this forum