Hi,
I'm trying to schedule an upload of the latest .csv file that has been created to 2 sftp remote servers, one that using RSA private key and the other that doesn't, using the task scheduler but it doesn't seem to work for me. I was wondering if you guys could help me out.
For server that DOESN'T use Private RSA Key:
Script.txt
# I copied that from Generate Script Code within WinSCP
open sftp://ftpuser:password@ftp.example.ca/ -hostkey="ssh-rsa 2048 00-000-0-0-00-0=" -rawsettings ProxyPort=0 (the port for the server is 22, should I change that even if it was autogenerated script based on the working settings?)
lcd C:\Users\myuser\Dropbox\Portfolio\Position Files\
put *.csv /From_Me/ latest -nopreservetime
exit
Task Scheduler Action
Program/Script
"C:\Program Files (x86)\WinSCP\WinSCP.exe"
Arguments:
/log="C:\Users\Gab\Dropbox\Nymbus Bonds\Portfolio\Logs\position_file.log" /ini=nul /script="C:\Users\Gab\Dropbox\Nymbus Bonds\Portfolio\position_file_script.txt"
__________________________________________________________________________
For server that DOES use Private RSA Key:
Script.txt
# I copied that from Generate Script Code within WinSCP
open sftp://user@sftp.server2.com/ -hostkey="ssh-ed25519 256 00-000-000-000-000-000=" -privatekey="C:\Users\myuser\Dropbox\ssh-private-key.ppk" -rawsettings AgentFwd=1 GSSAPIFwdTGT=1 ProxyPort=1 (the port for the server is 22, should I change that even if it was autogenerated script based on the working settings?)
lcd C:\Users\myuser\Dropbox\Portfolio\Position Files\
put *.csv /From_Me/ latest -nopreservetime
exit
Task Scheduler Action
Program/Script
"C:\Program Files (x86)\WinSCP\WinSCP.exe"
Arguments:
/log="C:\Users\Gab\Dropbox\Nymbus Bonds\Portfolio\Logs\position_file.log" /ini=nul /script="C:\Users\Gab\Dropbox\Nymbus Bonds\Portfolio\position_file_script.txt"
Is there something I need to do differently in each scenario of with or without RSA private key for it work when I run the task scheduler? Right now it shows as task completed but nothing actually uploads to the remote servers. I've tried while keeping the application opened or keeping it closed. Either way, it doesn't work for the moment. Any suggestions for modifications?
Thank you!