Existing files are copied to destination every time

Advertisement

torix
Joined:
Posts:
16
Location:
Norway

Existing files are copied to destination every time

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

Reply with quote

Advertisement

torix

Log file

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.

Reply with quote

torix
Joined:
Posts:
16
Location:
Norway

Re: Existing files are copied to destination every time

martin wrote:

See https://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?

Reply with quote

martin
Site Admin
martin avatar

Re: Existing files are copied to destination every time

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.

Reply with quote

Advertisement

You can post new topics in this forum