P
P
Pavel2017-08-15 22:21:14
cmd/bat
Pavel, 2017-08-15 22:21:14

How to write a script to delete sent WinSCPs from bat/command line?

using ftp file upload script

@echo off

"D:\SYNCING\google\soft\WinSCP\WinSCP.com" ^
  /log="D:\SYNCING\google\folder2\WinSCP.log" /ini=nul ^
  /command ^
    "open ftp://login:[email protected]/" ^
    "synchronize remote -criteria=time ..\send\ /log" ^
  "put ..\send\*.* /logServer/" ^
    "exit"

set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
  del /q D:\SYNCING\google\send\*.txt
) else (
  echo Error
)

exit /b %WINSCP_RESULT%

does not suit him that he deletes all files after a successful send, but if at the time of sending a new file appeared in the send directory, it will also be killed.
Is there a way to delete only those files that are 100% sent?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question