Help with script to FTP all files in a local folder to a remote server then delete the local files
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.
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.
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.
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.
Last edited by JW_PPCGroup on 2022-09-08 12:54; edited 1 time in total