how to apply offset to my powershell script ?
Use
TimeDifference
raw session settings:
https://winscp.net/eng/docs/rawsettings
Before posting, please read how to report bug or request support effectively.
Bug reports without an attached log file are usually useless.
how to apply offset to my powershell script ?
TimeDifference
raw session settings:
no upload, the need is only to download (mirror) an ftp to a local ntfs folder using winscp sync.
but having timestamp problems on destination files.
# Load WinSCP .NET assembly
$WinSCPfolderRoot="C:\Program Files (x86)\WinSCP\"
Add-Type -Path (Join-Path $WinSCPfolderRoot "WinSCPnet.dll")
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions
$sessionOptions.Protocol = [WinSCP.Protocol]::ftp
$sessionOptions.HostName = "dad"
$sessionOptions.UserName = "ftpuser_1"
$sessionOptions.Password = "Password1"
$session = New-Object WinSCP.Session
# Log
$session.SessionLogPath = "C:\MYPATH\MYFOLDER\backup.log"
# Connect
$session.Open($sessionOptions)
# Synchronize Files
$session.[WinSCP.TransferResumeSupportState]::On
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.ResumeSupport.State = [WinSCP.TransferResumeSupportState]::On
$synchronizationResult =
$session.SynchronizeDirectories([WinSCP.SynchronizationMode]::Local,"C:\MYPATH\MYFOLDER\DATAFOLDERLOCAL", "/datafolderftp/", $True, $True, [WinSCP.SynchronizationCriteria]::Either, $transferOptions)
$synchronizationResult.Check()
# Disconnect, clean up
$session.Dispose()
Feature request: it would be very nice if I could switch between using MFMT and MDTM to set timestamps because there are ftp-server like the default from IIS 7.5 which supports only MDTM to set timestamps.
If I update files to that share everything is okay when I have updated also the files before (no problem with the time stamp!).
This tracker shows that Bug#293 has been fixed as of version 4.2, but I am using version 4.27 and still having timestamp problems. (The copied files have the current timestamp rather than the original timestamp of the source.)
This issue has been added to tracker.
Sorry, I do not know how to help you. Obviously your server does not implement part of the SFTP functionality. You can avoid WinSCP using that functionality by option you already know. What more do you want?
.... and actually I am looking to get some background information, about "what is the standard" if i have to make some changes in setup on client side rather than on server side. Due the SFTP procotl is still in "Draft4" is it not so clear for me. Some other clients/servers are facing very similar issues. At this moment i have option for my client (thanks to "transfer presets") and also prove that "ipswitch's WS_FTP" has option to "check/uncheck" "preserve time on upload".
Actually, what I need is to know that MDTM command is used in proper way by WinSCP when the files are uploaded. I mean that the MDTM is not used to "change" but only to "retrieve" datetimestamp. For me, SFTP is just FTP covered in SSH tunnel so the commands are pretty same.
Error code: 8
Error message from server: SSHServerAPI.SFTP.fxp_attrs
Request code: 9
MDTM/MFTM commands are for FTP protocol. So it is unrelated to the SFTP. So actually I'm not sure what you are after. If you server does not support setting permissions/timestamp, what can WinSCP do?
Or maybe it will be great to have those options (preserve timestamp;ignore permission errors;set permission) optionable per session.
It can be configured per host using transfer settings presets.
Anyway, is it possible to make MDTM/MFTM situation once for all clear?
Do we (winscp) following the RFC specification for FTP/SFTP protocol at matter MDTM/MFTM or not?
Will be there any option like "legacy mod" (when facing the old server using MDTM in old fashion way?).
Or maybe it will be great to have those options (preserve timestamp;ignore permission errors;set permission) optionable per session.
The server does not support the operation.
Error code: 8
Error message from server: SSHServerAPI.SFTP.fxp_attrs
Request code: 9
What version of WinSCP are you using? What protocol are you using?