I'm having trouble with what should probably be a simple operation.
Background.
I have a server(A) generating logs behind a data diode. The logs are sent through the data diode to another local server(B) which will FTP any received logs to a remote FTP server. Once FTP transfer is completed then server(B) will delete the transmitted log file locally.
The script will be run via Windows Scheduled Tasks every 10 min.
- Check for new complete files (no partials) in local folder, if none then end script.
- If new files exist then FTP all new files to remote server directory.
- Delete newly uploaded files in local directory then end script.
Not sure how to avoid deleting any files that were arriving as or after script was started.
New to WinSCP & scripting but it seems to be a fairly common task. Maybe there is some premade subscripts I could piece together into a new script.