Topic "Scheduled Task Scripted Execution Woes"

Author Message
techtony
[View user's profile]

Joined: 2017-09-15
Posts: 1
Location: Austin, TX
For having never set this up to automate before, all in all, I think I'm doing pretty well. But alas, I'm stuck and could use some expert assistance.

The Goal - I need to automate the following processes:
- log into FTP server (nothing special, just UN and PW - no ssl or keyfiles)
- download all files based on filename mask (i.e.:get *.c2m /%DEST_Dir%)
- rename all newly downloaded filenames to append the date (done with a separate batch - would be great if I could kickstart that .cmd with my winscp .cmd)
- exit

What I have thus far:
Code:
Commands put forth by scheduled task:  "C:\program files (x86)\winscp\winscp.com"
Argument:  /ini="c:\install\scp\%Filename%.ini" /script=c:\install\scp\ftpscript.txt /log=c:\install\scp\ftpscript.log


'ftprun.cmd'
Code:
"C:\program files (x86)\winscp\winscp.com" /script=c:\install\scp\ftpscript.txt /log=c:\install\scp\ftpscript.log


'ftpscript.txt'
Code:
# no need for confirmation prompts where we're going
option confirm off

# connect to server
open ftp://%Redacted%:%Redacted%@ftp.%Redacted%.com/

# download all .C2M files to local dir M:\%Redacted%\%Redacted%\%Redacted%
get *.C2M M:\%Redacted%\%Redacted%\%Redacted%\

# delete files on dtn server
rm *.C2M

# good bye
bye


Works great when I execute the scripts manually...
execute ftprun.cmd ...once it finishes then I run my filename_appender.cmd
but my ftprun.cmd craps out every time when I run it from a scheduled task
read on the winscp site to use a defined .ini and path, so I am.. still don't work
Any assistance is appreciated.
ftpscript.log (10.15 KB) Private file

Description: Current Failure LogSensitive

filename.ini (14.83 KB) Private file

Description: %Filename%.ini

martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26705
Location: Prague, Czechia
I'd assume that the M: is a mapped drive and it's not accessible by the Windows Scheduler due to some local policy.

For a start, try to download to a local drive.
Guest




martin wrote:
I'd assume that the M: is a mapped drive and it's not accessible by the Windows Scheduler due to some local policy.

For a start, try to download to a local drive.



Good valid thought that hadn't even crossed my mind - so thanks for that! Smile
I've converted my filepaths to UNC paths and have applied 'pushd' and 'popd' commands where I think they should go. We'll see tomorrow morning if that resolves it. It'd be great if it turns out to be just that easy. I'll post a followup tomorrow.
So here's hoping...
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License