batch to download montly files from a linux server
hello,
we have a engine who generates joblogs on a linuxserver and put them all in a directory. i need those files for a monthly evaluation, so i have to copy them in the beginning of the new month on my windows laptop and run a vbs script to generate a xlms file.
now i try to make this by script.
this is what i have done till now
my batchfile:
@echo on
color f1
title MP14
set CURRENTTIME=%TIME%
set Filename=MP14-%DATE:~3,2%-%DATE:~6,4%
mkdir MP14
c:\"Program Files (x86)"\WinSCP\winscp.exe /console /script=winscp.txt
complete_xml.vbs c:\MP14 c:\%Filename%.xlsx
pause
and the winscp.txt file
option batch on
option confirm off
open sftp://username:password@IP-Adress
get -filemask=*>=2017-02-01<=2017-02-30 /var/opt/logs/* c:\MP14\
close
exit
this works fine,but in this case i have to adjust the filemask each month.
my questing now: is there a filemask to say winscp "copy all files from the last full month?" or do anybody know an other way to fix my problem?
for example:
at the 2th of May i need the Files from April. or at the 5 of June i need the files from May.
thanks for help
we have a engine who generates joblogs on a linuxserver and put them all in a directory. i need those files for a monthly evaluation, so i have to copy them in the beginning of the new month on my windows laptop and run a vbs script to generate a xlms file.
now i try to make this by script.
this is what i have done till now
my batchfile:
@echo on
color f1
title MP14
set CURRENTTIME=%TIME%
set Filename=MP14-%DATE:~3,2%-%DATE:~6,4%
mkdir MP14
c:\"Program Files (x86)"\WinSCP\winscp.exe /console /script=winscp.txt
complete_xml.vbs c:\MP14 c:\%Filename%.xlsx
pause
and the winscp.txt file
option batch on
option confirm off
open sftp://username:password@IP-Adress
get -filemask=*>=2017-02-01<=2017-02-30 /var/opt/logs/* c:\MP14\
close
exit
this works fine,but in this case i have to adjust the filemask each month.
my questing now: is there a filemask to say winscp "copy all files from the last full month?" or do anybody know an other way to fix my problem?
for example:
at the 2th of May i need the Files from April. or at the 5 of June i need the files from May.
thanks for help