Topic "Scripting in SSIS"

Author Message
ravensensei
[View user's profile]

Joined: 2009-03-31
Posts: 1
Location: White Plains NY
I am writing a task in SSIS to use WinSCP to grab some files from an SFTP site.
Code:
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@
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
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.

Quote:
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".
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License