Topic "Powershell SynchronizeDirectories"

Author Message
kretmatt
[View user's profile]

Joined: 2008-01-23
Posts: 4
Location: germany
Hello,
I try to sync a local directory by using the .NET Assembly with powershell.
After setting the SessionOptions, this is what I do:
Code:
$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.
Code:
$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
kretmatt
[View user's profile]

Joined: 2008-01-23
Posts: 4
Location: germany
I solved it my self.
I am sorry, I mixed up local and remote directory.

BR
Matthias
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License