I have tried every way I can think of and cant get this to work like I want it to. I am using WinSCP in SSIS thru an Execute Process Task. Goal is to logon to an SFTP site, Get and then Delete any files of types .txt, .csv, .xls, or .xlsx that are 5 days old or older. No matter what I try, it either includes file types that I didnt specify like .ssh or.vb, or it moves and deletes folders that I am not even in. I have tried using CD right before the GET statement and also tried specifying the folder in the GET statement, but some reason it does not limit its search to the folder I specify. Also, if it doesnt find the folder that I specify, it just Gets and Deletes everything in the root folder that is 5 days or older. That is crazy. Here is what I used for my last 2 attempts:
get -delete -filemask= "*<5D" /FTP_ETLTEST01/Outbound/
get -delete -filemask= "*.txt<5D;*.xls<5D;*.csv<5D;*.xlsx<5D" /FTP_ETLTEST01/Outbound/
I typed those from memory, so I may be missing some punctuation. Not at my computer right now. However, both either moved and deleted file types that I did not specify or moved and deleted whole folders that were not in the folder I specified.
How can I write this statement so that it does what I want it to?
I am running Windows 7 Pro, Visual Studio 2012,and WinSCP 220.127.116.11, File Version 18.104.22.16858
Thanks in Advance!!!