Posted: 2016-11-16 13:59
I have got a job which builds a script (by echoing out the commands to a text file) and which is then executed by WinSCP to upload some files. I am trying to tell it to upload CSV files created within e.g. 60 minutes. The trouble is that it is ignoring the mask and uploading all the files.
echo open %oracle_usr%:%oracle_pwd%@%oracle_svr% -hostkey=%oracle_key% > SSH_SCRIPT3.TXT
echo lcd %EXTRACT_DIR% >> SSH_SCRIPT3.TXT
echo cd %oracle_dir% >> SSH_SCRIPT3.TXT
echo put %TRANSACTION_EXTRACT_DIR%\FINANCE*.csv*^\>60N%DD%%MM%%YYYY%^ >> DPA_SSH_SCRIPT3.TXT
60N sets it to only get files created within the last 60 minutes and %DD%%MM%%YYYY% is the timestamp format (UK).
Because I am piping it out to a file I have escaped it with the ^ character.
~Even if I drop %DD%%MM%%YYYY% and just have ^>10N^ it still uploads all the files.
Location: Prague, Czechia
- But you have to escape the
- I also do not understand, why are you adding the
- Why is a script name different?
This should be working:
Though this is more safe and you do not need any escaping:
You can post new topics in this forum
And it's free!