Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Rookie1111

Re: Upload script works from command prompt, but not from job

martin wrote:



Thank you. I resolved the issue by making some changes to the SQL Server Agent, but this looks like the better method...I'd seen other postings about this but they were not as clear.
Rookie1111

Upload script works from command prompt, but not from job

This upload script (FTPS) works fine when I run it from the command prompt, but when I run the same command from a SQL Server scheduled job, it dies on an interactive request for a password from the host I am uploading to. The log file shows that when run from the command prompt, it runs using a modified stored session, but when run from the job, it uses an ad-hoc session. I suspect if I could get the job to use the modifed stored session, it would work, but I can't figure out how...I am a VERY novice user. This is running on WindowsServer 2003 by the way, and am using the current version of WinSCP - downloaded this week.

Script:
option batch abort
option confirm off
open something@someftp.gov -hostkey="key here"
put e:\ProdData\ftpexport\076\staging\*.re1
exit

Command:
"C:\Program Files\WinSCP\WinSCP.com" /script=e:\ProdData\ftpexport\076\scripts\076_ftpscript.scp /log=e:\ProdData\ftpexport\076\bak\ftptest.log