I know this must be a stupid question, but I'm getting mad for this...
I need to daily tranfer a folder from a Windows Server to a Red Hat one.
This folder on the windows server has the naming convention of "Stats_dd-mm-yyyy".
I'm trying to create a script for automate a daily sftp between this two folder, but I'm not able to pass the "date" variable.
Here is the script i'm trying:
#Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
#SET DATE VARIABLE
open sftp://user:email@example.com -hostkey="ssh-rsa 1024 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
# Force binary mode transfer
option transfer binary
#Put file to the remote directory /tmp
put C:\Scripts\output\%Stats_dd-mm-yyyy% /tmp/test_Stats/
# Exit WinSCP
Every time I run this I get error becouse of the "set" command, it's not recognized...
Where am I wrong?????