sftp automation from remote to local
Sorry for the question; but have spent all day on this. my script is connecting to the database; but it isn't downloading then deleting the files from the Remote server to the local machine. I'm not sure what I have wrong and can connect with all - F6 from the "CHANNELNAME" works correctly; but the script below is aligned in schedule tasks; not returning any errors; but not returning any data or deleting any data. (*NOTE the RSA KEY IS VERIFIED ACCURATE/STRIPPED FOR SECURITY)
# Do not to stall on errors
option batch on
# Disable overwrite confirmations
option confirm off
# Connect
open CHANNELNAME -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Set automatic transfer mode to accomidate PDF and HL7 text files.
# Text file extentions are stored in WinSCP.ini
option transfer automatic
# Download and then delete remote files.
# Local and remote directories are stored in WinSCP.ini
get *.* .\ -delete
# Disconnect
close
exit
# Do not to stall on errors
option batch on
# Disable overwrite confirmations
option confirm off
# Connect
open CHANNELNAME -hostkey="ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Set automatic transfer mode to accomidate PDF and HL7 text files.
# Text file extentions are stored in WinSCP.ini
option transfer automatic
# Download and then delete remote files.
# Local and remote directories are stored in WinSCP.ini
get *.* .\ -delete
# Disconnect
close
exit