Delete multiple files from FTP Server after downloading and processing.

Advertisement

dbWizard
Joined:
Posts:
7

Delete multiple files from FTP Server after downloading and processing.

I am currently running a script which downloads files once a day from a remote FTP server. After performing the download, and manipulating the data, I want to make another trip back to the server and delete only the files that I previously downloaded. I cannot simply do a:

rm *.xml

because files are continuously written to the ftp server at somewhat random times, so one or more records which I have not previously downloaded may appear on the FTP server between the time I finish the download and am ready to delete the files. I'm currently using a script that looks something like:

open ftpes://UserId:Pasword@URL// -Explicit
# Change the remote directory
cd /XML/Test/Out/
rm 0000013261_ABC_CORP_4154795_20160608-083436-089.xml
rm 0000013261_ABC_CORP_4154886_20160608-083548-112.xml
Exit

But that is not working, and on occasion, there may be more than 1000 records. How do I change that script to delete multiple files at a time?

Reply with quote

Advertisement

dbWizard
Joined:
Posts:
7

Delete multiple files from FTP Server after downloading and processing.

"If you do not want to use .NET assembly: Perform the synchronization using synchronize command. Make sure the script generates XML log file. You can then parse the log file to enumerate files that got successfully transferred, and use the list, to generate script to delete the source copies. "

1. I do not want to use the .Net assembly, I am using VB Script
2. I don't want to "synchronize" and delete because I have multiple sites performing downloads at different times
3. I have a log file and am able to parse the file, but the command syntax I provided above to remove multiple files from the FTP server does not work.

Reply with quote

dbWizard
Joined:
Posts:
7

Delete multiple files from FTP Server after downloading and processing.

Issue closed.

It had to do with the command line that I was creating to run the script.

Reply with quote

Advertisement

You can post new topics in this forum