Sync: REMOTE timestamp diff between SCP and SFTP

Advertisement

Ron
Joined:
Posts:
9
Location:
Boston, MA USA

Sync: REMOTE timestamp diff between SCP and SFTP

Hi,
I just d/l the newest version of standalone WinSCP and came across what seems to be a bug. I left the default SFTP in place (by accident) and wound up with a few thousand differences during synchronization (I have a very large filesystem that I sync). The differences were older files with timestamps all off by exactly 1 hour.

I suspected a few possibilities: a DST issue, a WinSCP version issue or a computer migration issue (as this was my first WinSCP run on a new local PC). To begin investigating, I tried re-running the sync on a small directory on my old system and there were no diffs. I checked the FAQs about timestamps.

Then I realized I was running under SFTP on the new system and SCP on the old. I changed the new system to login under SCP and re-ran the sync and there were no diffs.

So there is no migration issue, and there doesn't appear to be a DST issue under SCP. It appears that there is a difference in the way someone (SFTP, SCP, Windows or WinSCP) is handling timestamps between SCP and SFTP.

My new PC is running Windows 7 and WinSCP v. 4.2.7 (Build 758).

I confirmed this behaviour on the old PC which is running Windows XP (32 bit) and WinSCP v. 4.1.8 (Build 415).

I checked some timestamps- when running WinSCP under SFTP, the local timestamp in the sync checklist agrees with the timestamp when I look at the local file using windows explorer. The remote timestamp is advanced by 1 hour.

Under Linux, the timestamp for the file (ls --full-time) shows
2004-03-23 02:38:10.000000000
Under windows the time shows as
3/23/2004 3:38:10 AM
In the sync list local: (SFTP)
3/23/2004 3:38:10 AM
In the sync list remote: (SFTP)
3/23/2004 4:38:10 AM
(under SCP WinSCP sync shows no differences)

Logging in and visually inspecting the remote timestamp for the same file:
SFTP:
3/23/2004 4:38:10 AM
SCP:
3/23/2004 3:38:10 AM

Good Luck,
-Ron

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

Re: Sync: REMOTE timestamp diff between SCP and SFTP

I'm working on this. Timestamp handling has changed in Windows 7. I'll post updates once I have some.
_________________
Martin Prikryl

Reply with quote

Guest

Hi Martin,

I'm not sure this is just a Windows 7 issue-- I also confirmed the same behavior running under XP and an older version of WinSCP.

I confirmed this behaviour on the old PC which is running Windows XP (32 bit) and WinSCP v. 4.1.8 (Build 415).

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
27,226
Location:
Prague, Czechia

OK, reading your message carefully again...
SCP protocol is not reliable regarding timestamps. It is hardly possible to make it work consistently with SFTP (which hopefully is reliable as it is implemented in WinSCP). More over Windows 7 changed a way timestamps are shifted when DST in turned on or off. The latest released version of WinSCP does not account for that yet. The next one will. So either stick with SCP for now. Or if you want to switch to SFTP, do, but perform timestamp synchronization.
_________________
Martin Prikryl

Reply with quote

Advertisement

You can post new topics in this forum