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

shcsbaker

Synchronize over IP vs over local network

I have a Win 2008 R2 server and a Synology Rackstation sitting in a datacenter. Each have their own IP address. Since both have multiple NIC ports, I've connected the server directly to the synology using local ip addresses. On server it's 10.0.0.1 and the Synology has 10.0.0.2. Each night I sync files from Server to the Synology using a command line from inside Powershell. Option 1 below works great and is VERY Fast, Option 2 gets Lost Connection Timeout detected. (data connection) could not retrieve directory listing. Option 3 works but is VERY SLOW (10+ mins). I need to use the 10.0.0.2 ip address because those transfers don't count against my bandwidth.

Option 1:
& D:\winscp.com /ini=nul /command 'open ftp://[user]:[pass]@[ip]' 'synchronize remote C:\HB\LocalUser /home/Data' 'exit'

Option 2
& D:\winscp.com /ini=nul /command 'open ftp://[user]:[pass]@10.0.0.2' 'synchronize remote C:\HB\LocalUser /home/Data' 'exit'

Option 3
Add-Type -Path "D:\PSDaily\WinSCPnet.dll"

$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = "10.0.0.2"
$sessionOptions.UserName = "user"
$sessionOptions.Password = "password"


$session = New-Object WinSCP.Session
$session.Open($sessionOptions)

$session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Remote, "C:\HB\LocalUser", "/home/Data", $False)


$session.Dispose()