Powershell SynchronizeDirectories
Hello,
I try to sync a local directory by using the .NET Assembly with powershell.
After setting the SessionOptions, this is what I do:
I do not know what is wrong, I am using the example of this page (with the change from Remote to Local Sync).
When I do a ListDirectory of the source everything is fine.
Could somebody give me a hint?
Thank you very much in advance.
BR
Matthias
I try to sync a local directory by using the .NET Assembly with powershell.
After setting the SessionOptions, this is what I do:
$session = New-Object WinSCP.Session
$session.SessionLogPath = ".\SessionLogFile.log"
$session.Open($sessionOptions)
$session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Local, "/storage/hd0b/wm/config_backup", ".\config_backup", $True, $True)
Uploads : {}
Downloads : {}
Removals : {}
Failures : {WinSCP.SessionRemoteException: Error listing directory '/storage/hd0b/wm/config_backup'. ---> WinSCP.Sessi
onRemoteException: Error retrieving file list for "/storage/hd0b/wm/config_backup\*.*".
System Error. Code: 3.
Das System kann den angegebenen Pfad nicht finden
--- Ende der internen Ausnahmestapelüberwachung ---, WinSCP.SessionRemoteException: Error listing direct
ory '/storage/hd0b/wm/config_backup'. ---> WinSCP.SessionRemoteException: Error retrieving file list for "/
storage/hd0b/wm/config_backup\*.*".
System Error. Code: 3.
Das System kann den angegebenen Pfad nicht finden
--- Ende der internen Ausnahmestapelüberwachung ---}
IsSuccess : FalseWhen I do a ListDirectory of the source everything is fine.
$session.ListDirectory("/storage/hd0b/wm/config_backup")
Files
-----
{config_20140515_2030.tar.gz, config_20140904_2030.tar.gz, config_20140626_2030.tar.gz, config_20141106_2030.tar.gz...}Could somebody give me a hint?
Thank you very much in advance.
BR
Matthias