Two-way synchronization with delete with SFTP/FTP server with script automation (Task scheduler)

Advertisement

Stay_happy
Joined:
Posts:
10

Two-way synchronization with delete with SFTP/FTP server with script automation (Task scheduler)

Hello,
I want to use this https://winscp.net/eng/docs/library_example_two_way_synchronize_delete command in a script with the Windows 10 Task scheduler. But when I try it i get the error:
Script: Unbekannter Befehl „F:\...\SynchronizeTwoWayDelete.ps1“.
I want the command to automatically synchronize two folders. This should happen in the background and as efficiently as possible.

My script:
open sftp://.../ -hostkey="ssh-rsa 2048 ..." -rawsettings FSProtocol=2
ExecutionPolicy Bypass -File "F:\...\SynchronizeTwoWayDelete.ps1" -sessionUrl "sftp://...;fingerprint=ssh-rsa-...@.../" -localPath "C:\...\Neue Fotos sync both delete" -remotePath "/Camera/" -listPath "F:\...\cache.txt"
exit
I would be very happy if anybody could help me because I have been trying for many days to get it to work.

Thank you

Reply with quote

Advertisement

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

Re: Two-way synchronization with delete with SFTP/FTP server with script automation (Task scheduler)

You are on a wrong track.
That is a PowerShell script. It has nothing to do with WinSCP scripting.
You have to execute that script standalone (like from a batch file or PowerShell), not from WinSCP script.
Example of the command-line needed to run the script is given on the script article:
https://winscp.net/eng/docs/library_example_two_way_synchronize_delete

Reply with quote

Advertisement

You can post new topics in this forum