URGENT:. FileMask script error "Missing parameter for command 'put'

Advertisement

jatin1230
Joined:
Posts:
4
Location:
United States

URGENT:. FileMask script error "Missing parameter for command 'put'

Hi

I am new to WINSCP. I am trying to auto sync my local folder using timestamp only for hailstorm 2018 files which is "hail-2018*.csv.gz" from NOAA website.

I wrote this script below:

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/command ^
"open ftp://username:password@ftp.ncdc.noaa.gov/" ^
"cd pub/data/swdi/database-csv/v2/" ^
"lcd ""D:\Data NOAA\HailZips""" ^
"put -filemask=*>=%%TIMESTAMP#mm-dd-yyyy%%" ^
"get hail-2018*.csv.gz" ^
"exit"

exit /b %WINSCP_RESULT%

ERROR: Missing parameter for command 'put'

Basically I want this script to run daily and sync my local folder with NEW and UPDATED hail 2018 files. Its a bit urgent, I would really appreciate somebody's help. Thanks a lot.

Reply with quote

Advertisement

jatin1230
Joined:
Posts:
4
Location:
United States

Some progress but still stuck

Looks like some progress but I am still stuck

Updated the code to this (changes are only in timestamp row):

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/command ^
"open ftp://username:password@ftp.ncdc.noaa.gov/" ^
"cd pub/data/swdi/database-csv/v2/" ^
"lcd ""D:\Data NOAA\HailZips""" ^
"get -filemask=*>=%%TIMESTAMP#mm-dd-yyyy_%% hail-2018*.csv.gz " ^
"exit"

exit /b %WINSCP_RESULT%


ERROR: Mask is invalid near '=03-15-2018'

This is how timestamp looks on the server: 3/14/18, 9:07:00 PM
Please help. Thanks.

Reply with quote

jatin1230
Joined:
Posts:
4
Location:
United States

Finally it works!!

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/command ^
"open ftp://username:password@ftp.ncdc.noaa.gov/" ^
"get pub/data/swdi/database-csv/v2/hail-2018*.csv.gz>=%%TIMESTAMP#yyyy-mm-dd%% D:\DataNOAALatest\" ^
"exit"

exit /b %WINSCP_RESULT%


This downloads the latest hail-2018 file by timestamp

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,469
Location:
Prague, Czechia

jatin1230 wrote:

A quick question whats the difference if i use get -latest or timestamp.
With -latest switch, you download the latest file. With timestamp, you download all files created/modified after the timestamp.

Reply with quote

Advertisement

You can post new topics in this forum