Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

kretmatt

I solved it my self.
I am sorry, I mixed up local and remote directory.

BR
Matthias
kretmatt

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:
$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 : False

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.
$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