Topic "Cant Get Delete Functionality to Work Like I Need it To"

Author Message
[View user's profile]

Joined: 2017-06-05
Posts: 7
Location: Dallas, TX
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, File Version

Thanks in Advance!!!
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26515
Location: Prague, Czechia
Your duplicate post:

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License