Posted: 2013-09-13 15:55
Hello everyone, I've been working on making an automated script for awhile now with WinSCP but I've encountered a few road blocks and seem to be stuck right now, I was hoping someone could help.
The goal of the script:
Connect to the sftp site A and download 5 text files every day at X time (say 10AM) these 5 files never have a different name, just updated contents. I need these 5 text files that I am downloading to be downloaded to a folder on my local computers network.
I can't seem to get the "get" command to send the downloaded files to anywhere outside of the folder path that the files reside in (Site A). It seemed to me that the synchronize command could better replace the get command but I wasn't able to get a successful version of that to work either.
A working form of either or these would be extremely appreciated.
Here's a script I made as a local test that works (Connecting to a local server and saving the files locally with get):
title Automated File Transfer
REM This first line is used to take our current file and send it to our backup folder.
winscp.exe /console /command "option batch abort" "option confirm off" "open ftp://alice:firstname.lastname@example.org" "cd /CurrentFilesOnly/" "get currentTest.txt C:\Users\alice\Desktop\Backup\oldTest.txt" "exit"
REM Next we use this final line to replace our current file with the newest released file.
winscp.exe /console /command "option batch abort" "option confirm off" "open ftp://alice:email@example.com" "cd /NewFilesOnly/" "get newTest.txt C:\Users\alice\Desktop\CurrentFilesOnly\currentTest.txt" "exit"
Thanks in advance if anyone can help me figure out how to modify this for my goal usage or if someone can show me the proper way to use synchronize (I read the guides, but I just didn't seem to understand it the way it was put).
Location: Prague, Czechia
Sorry, I do not understand what you are trying to do. Particularly, the part "to send the downloaded files to anywhere outside of the folder path that the files reside in (Site A)".
Don't you want to upload files (
You can post new topics in this forum
And it's free!