I like to use date variables in a PuTTY/PSFTP batch-script to select files with a certain timestamp in the filename.
But I couldn't find anything in the docs. Is there a command for PuTTY/PSFTP batch-script to use date-variables or is there a way to pass Windows Batch Variables to PSFTP?
The file looks like this: FILENAME_2015-06-25.TXT
(based on the current date)
Something like this:
cd /subdir
get FILENAME_%year%-%month%-%day%.TXT
quit
In a Windows Batch File i can easily get the current date by something like this:
SET YEAR=%DATE:~-4%
SET MONTH=%DATE:~-7,2%
SET DAY=%DATE:~-10,2%
ECHO FILENAME_%YEAR%-%MONTH%-%DAY%.TXT