Timestamped log file for WinSCP FTP script

Viewed 82

I'm trying to make an FTP script to move files on my local PC to the NAS on a scheduler. I want every time the FTP script is run it creates a new log per day. This is the script I made:

@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\writable\path\to\log\WinSCP.log" /ini=nul ^
  /command ^
    "open ftp://USER-NAS:PASSWORD%%21%%21%%21@10.xx.xxx.xx/" ^
    "lcd D:\WORK" ^
    "cd /BackupARC-Veeam" ^
    "put ""List Server Rak Abu-Abu.xlsx""" ^
    "exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)

exit /b %WINSCP_RESULT%

The script that I made is running fine, it's just that the logs don't match what I want.

1 Answers
Related