I am trying to write the batch script but not sure how to check the below condition.
I want to read all 3-digit number's folders and the 'data' folder only as first level directory, and inside these folders there are date folders, and sync only 'ping' and 'event' folders files.

Also, is there any way to sync the date range instead of using the DAYS variable?
@echo off
SET SOURCE_PATH=Z:\Logs
SET DEST_PATH=/mnt/logs/test
set DAYS=2
for /l %%D in (1, 1, %DAYS%) do (
for /d %%i in (%SOURCE_PATH%) do (
REM synchronize folder from network drive to FTP
"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
/log="C:\Users\rjdhld\WinSCP.log" /ini=nul ^
/command ^
"open sftp://username:%%21o%%26mH%%[email protected]/ -hostkey=""ssh-ed29 255 s8HgnuJoit0""" ^
"option batch continue" ^
"mkdir %DEST_PATH%/%%~nxi" ^
"mkdir %DEST_PATH%/%%~nxi/%%TIMESTAMP-%%DD#yyyy-mm-dd%%" ^
"mkdir %DEST_PATH%/%%~nxi/%%TIMESTAMP-%%DD#yyyy-mm-dd%%/ping" ^
"mkdir %DEST_PATH%/%%~nxi/%%TIMESTAMP-%%DD#yyyy-mm-dd%%/event" ^
"option batch abort" ^
"synchronize remote %%~fi\%%TIMESTAMP-%%DD#yyyy-mm-dd%%\ping %DEST_PATH%/%%~nxi/%%TIMESTAMP-%%DD#yyyy-mm-dd%%/ping" ^
"synchronize remote %%~fi\%%TIMESTAMP-%%DD#yyyy-mm-dd%%\event %DEST_PATH%/%%~nxi/%%TIMESTAMP-%%DD#yyyy-mm-dd%%/event" ^
"exit"
)
)
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
echo Success
) else (
echo Error
)
PAUSE
exit /b %WINSCP_RESULT%