Topic "Existing files are copied to destination every time"

Author Message
torix
[View user's profile]

Joined: 2015-11-11
Posts: 15
Location: Norway
I have created a Powershell script to synchronize files from a source- to destination folder. The target is a Microsoft IIS FTP-server.

Copying is based on the following method:
SynchronizeDirectories([WinSCP.SynchronizationMode]::Remote
... and should synchronize a remote folder based on the contents of the source folder.

All worked great for days and subsequent runs just copied only the new files as it should. THEN at some point in time it just started copying all files every time and I have not figured out the reason. It could be as part of my code being developed, affecting the behavior, but I feel its pretty standard with regards to setting up the session. Date / time is preserved on the remote folders.

I have set the following session options:
-----------------------------------------------------
$sessionOptions.Protocol = $script:protocol
$sessionOptions.HostName = $script:ftpserver
$sessionOptions.UserName = $script:user
$sessionOptions.Password = $script:password
$sessionOptions.FtpMode = [WinSCP.FtpMode]::Passive

Transfer options:
------------------------------------------------------
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferOptions.PreserveTimestamp = $true

Any idea?

Regards
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
See http://winscp.net/eng/docs/troubleshooting#timestamps

Or attach a complete session log file, naming one of the problematic files.
torix
[View user's profile]

Joined: 2015-11-11
Posts: 15
Location: Norway
I have attached the log file. User names, passwords, server references, domains has been wiped. Since the file structure contain about 50000 files, I broke the job after some time as this would have resulted in a massive log file.
torix
[View user's profile]

Joined: 2015-11-11
Posts: 15
Location: Norway
prikryl wrote:
See http://winscp.net/eng/docs/troubleshooting#timestamps

Or attach a complete session log file, naming one of the problematic files.


I turned off IIS-FTP and instead installed Bitvise SSH Server, personal certificate and started my script and then synchronization worked perfectly. Still the same servers in both ends so maybe IIS-FTP/SFTP is not the ideal choice?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
I was asking for a session log file, not debug log file. If possible, I'd still like to see it.

Anyway, indeed IIS is not a good choice for file synchronization.
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