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?