I've got a few SSIS packages that copy files from an SFTP server to a local folder, and the SSIS package then processes the files.
I'm currently doing this with batch files and calling psftp. I'm aware of WinSCP and an SSIS add in for SFTP dll i could use as well, but have not dug into them yet.I've also seen an opensource powershell snap in for SFTP as well. switching to anything that works better is fine with me.
my problem seems to lie with psftp , but it may be a windows issue, or it may be a SFTP server(WSFTP Pro) issue.
i need to either remove the files form the main folderon the FTP site, or delete them; either would work fine for my process.
I have a script file with these basic commands:
mv *.zip ./ARCHIVE
the problem is, whether is use the rm (remove command) or the mv(move command) WITH A WILDCARD, it fails.
if i were to explicitly remove specific files by name, it works:
so, as i'm trying to bring my command line skills up to strength, im looking to try and use a FOR loop to issue the command for each file i just downloaded to remove or archive them.
my question is any of the following:
have you seent his behavior yourself, and did you resolve it the same way i plan?
if you use WINSCP, do you have the same issue with wildcards?
how do you handle similar issues, where you need to remove multiple files via SFTP?
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!