Posted: 2015-03-31 19:26
I need to download three files everyday at 7:00 a.m. from a remote server, and place them on my desktop (then a sql server job picks them up and inserts into the tables).
When signed-in the remote server, there are 3 folders as follows:
In the <Folder 3>, there are two more folders and six files (three of them are log and the other three are text files). I need to download the ‘txt’ files, which are shown in red color below:
Please note that the number <12345> is dynamic and it changes everyday.
To test with one file, I wrote the script to automatize the downloading of the file as below:
/command "option batch abort" "option confirm off" "open sftp://<user>:<password>@<website.com >/<Folder 3>/<abc_*_txt>" "get c:\<local_filename.txt>" "exit"
Since the number part of the file name changes dynamically everyday, I have used ‘*’.
In Windows 7, I have scheduled a task to run the script automatically, and placed the above script in ‘Add arguments (optional)’ field. The ‘Program/script’ field looks as follows: ‘C:\Users\Downloads\winscp571setup.exe’
At the designated time (7:00 a.m) the Windows7 task scheduler is triggering the task. But the task “appear to” run endlessly and not completing the run even after 2 hours (the file being tested is of 6000 bytes. Other files are very huge).
Please help me with the correct script and the steps I need to follow.
Location: Prague, Czechia
There's no red color in your post, so I do not know which files you want to download.
Anyway, the command-line would be like (with WinSCP 5.7.1):
Note that I added a
You can post new topics in this forum
And it's free!