Cant Get Delete Functionality to Work Like I Need it To

Advertisement

jdiesel33
Joined:
Posts:
7
Location:
Dallas, TX

Cant Get Delete Functionality to Work Like I Need it To

Hello,
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 5.9.2.0, File Version 5.9.2.6958

Thanks in Advance!!!

Reply with quote

Advertisement

Advertisement

You can post new topics in this forum