Keep Remote Directory Up to Date with Delete source file.

Advertisement

aali
Joined:
Posts:
1
Location:
Riyadh

Keep Remote Directory Up to Date with Delete source file.

I tried to use Keep remote Directory Up to Date with delete option but it delete the file from destination. I found that I can use
put -delete C:\source\* /dest/
to fulfill my requirement but I don't know how to run this with keep up to date option all the time.

Reply with quote

Advertisement

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

Re: Keep Remote Directory Up to Date with Delete source file.

WinSCP does not have such functionality. The purpose of the "keepuptodate" is synchronizing the folders, while you are moving the files from local folder to the remote one.
You can loop your WinSCP move script, like this:
:retry
 
winscp.com /script=script.txt
 
goto retry
Though that's bit inefficient, as you will be authenticating over and over again.
More efficient would be to move to PowerShell and WinSCP .NET assembly.
https://winscp.net/eng/docs/library_powershell#net

Reply with quote

Advertisement

You can post new topics in this forum