Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

JW_PPCGroup

Actually I was hoping someone already had a script written since I think it's a fairly generic task. I've been tasked with figuring it out though I haven't any WinSCP experience.
martin

Re: Help with script to FTP all files in a local folder to a remote server then delete the local files

That's what -delete does:
put -delete *


Though this won't cover the 1. It is rather vague requirement anyway. Not sure what you exactly mean by it.
JW_PPCGroup

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.

  1. Check for new complete files (no partials) in local folder, if none then end script.
  2. If new files exist then FTP all new files to remote server directory.
  3. 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.