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

Author Message
jdiesel33
[View user's profile]

Joined: 2017-06-05
Posts: 7
Location: Dallas, TX
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!!!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26515
Location: Prague, Czechia
Your duplicate post:
https://winscp.net/forum/viewtopic.php?t=24994
Advertisements

You can post new topics in this forum






Search

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