synchronize always copies when criteria=time

Advertisement

Marcos
Guest

synchronize always copies when criteria=time

I am trying to use the synchronise command. The server is in a different timezone, but from what I've read WinSCP uses UCT to compare..?
What am I missing?

If I use -criteria=size it works fine but if I use -criteria=time then it is always copying to the server.
So this works
option batch on
option confirm off
open ftp://user:pass@ftp.myserver.com
synchronize remote "G:\..\TestLocal" Test -criteria=size
close
Exit WinSCP
Log is:
. 2010-06-23 11:54:15.837 --------------------------------------------------------------------------
. 2010-06-23 11:54:15.842 WinSCP Version 4.2.7 (Build 758) (OS 6.1.7600)
. 2010-06-23 11:54:15.842 Login time: Wednesday, 23 June 2010 11:54:15 a.m.
. 2010-06-23 11:54:15.842 --------------------------------------------------------------------------
. 2010-06-23 11:54:15.842 Session name: user@ftp.MyServer.com
. 2010-06-23 11:54:15.842 Host name: ftp.MyServer.com (Port: 21)
. 2010-06-23 11:54:15.843 create procedure [dbo].[ name: user (Password: Yes, Key file: No)
. 2010-06-23 11:54:15.843 Tunnel: No
. 2010-06-23 11:54:15.843 Transfer Protocol: FTP
. 2010-06-23 11:54:15.843 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2010-06-23 11:54:15.851 Proxy: none
. 2010-06-23 11:54:15.851 FTP: FTPS: None; Passive: No [Force IP: No]
. 2010-06-23 11:54:15.851 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-06-23 11:54:15.851 Cache directory changes: Yes, Permanent: Yes
. 2010-06-23 11:54:15.851 DST mode: 1
. 2010-06-23 11:54:15.851 --------------------------------------------------------------------------
. 2010-06-23 11:54:15.859 Connecting to ftp.MyServer.com ...
. 2010-06-23 11:54:16.284 Connected with ftp.MyServer.com. Waiting for welcome message...
< 2010-06-23 11:54:16.508 220-
< 2010-06-23 11:54:16.928 220 MyServer FTP Server ready
> 2010-06-23 11:54:16.928 create procedure [dbo].[ user
< 2010-06-23 11:54:17.149 331 Password required for user
> 2010-06-23 11:54:17.149 PASS *********
< 2010-06-23 11:54:17.448 230 create procedure [dbo].[ user logged in
> 2010-06-23 11:54:17.449 SYST
< 2010-06-23 11:54:17.666 215 UNIX Type: L8
> 2010-06-23 11:54:17.667 FEAT
< 2010-06-23 11:54:17.886 211-Features:
< 2010-06-23 11:54:17.886  MDTM
< 2010-06-23 11:54:17.886  MFMT
< 2010-06-23 11:54:17.886  TVFS
< 2010-06-23 11:54:17.886  MFF modify;UNIX.group;UNIX.mode;
< 2010-06-23 11:54:17.886  MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
< 2010-06-23 11:54:17.886  SITE MKDIR
< 2010-06-23 11:54:17.886  SITE RMDIR
< 2010-06-23 11:54:17.886  SITE UTIME
< 2010-06-23 11:54:17.886  SITE SYMLINK
< 2010-06-23 11:54:17.886  REST STREAM
< 2010-06-23 11:54:17.886  SIZE
< 2010-06-23 11:54:18.306 211 End
. 2010-06-23 11:54:18.408 Connected
. 2010-06-23 11:54:18.408 --------------------------------------------------------------------------
. 2010-06-23 11:54:18.408 Using FTP protocol.
. 2010-06-23 11:54:18.408 Doing startup conversation with host.
> 2010-06-23 11:54:18.409 PWD
< 2010-06-23 11:54:18.629 257 "/" is the current directory
. 2010-06-23 11:54:18.629 Getting current directory name.
. 2010-06-23 11:54:18.629 Startup conversation with host finished.
. 2010-06-23 11:54:18.631 Collecting synchronization list for local directory 'G:\dev\Merlot\branches\Main - Clean\Code\Build\TestLocal' and remote directory 'Test', mode = 0, params = 1538
. 2010-06-23 11:54:18.631 Retrieving directory listing...
> 2010-06-23 11:54:18.632 CWD /Test/
< 2010-06-23 11:54:18.854 250 CWD command successful
> 2010-06-23 11:54:18.854 PWD
< 2010-06-23 11:54:19.075 257 "/Test" is the current directory
> 2010-06-23 11:54:19.075 TYPE A
< 2010-06-23 11:54:19.293 200 Type set to A
> 2010-06-23 11:54:19.294 PORT 192,168,1,71,8,167
< 2010-06-23 11:54:19.714 200 PORT command successful
> 2010-06-23 11:54:19.715 LIST -a
< 2010-06-23 11:54:20.154 150 Opening ASCII mode data connection for file list
< 2010-06-23 11:54:20.570 226 Transfer complete
. 2010-06-23 11:54:20.570 Directory listing successful
. 2010-06-23 11:54:20.580 Disconnected from server
But if I use -criteria=time then I get
. 2010-06-23 12:02:49.618 --------------------------------------------------------------------------
. 2010-06-23 12:02:49.618 WinSCP Version 4.2.7 (Build 758) (OS 6.1.7600)
. 2010-06-23 12:02:49.618 Login time: Wednesday, 23 June 2010 12:02:49 p.m.
. 2010-06-23 12:02:49.618 --------------------------------------------------------------------------
. 2010-06-23 12:02:49.618 Session name: user@ftp.MyServer.com
. 2010-06-23 12:02:49.618 Host name: ftp.MyServer.com (Port: 21)
. 2010-06-23 12:02:49.619 User name: user (Password: Yes, Key file: No)
. 2010-06-23 12:02:49.619 Tunnel: No
. 2010-06-23 12:02:49.619 Transfer Protocol: FTP
. 2010-06-23 12:02:49.619 Ping type: C, Ping interval: 30 sec; Timeout: 15 sec
. 2010-06-23 12:02:49.619 Proxy: none
. 2010-06-23 12:02:49.619 FTP: FTPS: None; Passive: No [Force IP: No]
. 2010-06-23 12:02:49.619 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-06-23 12:02:49.619 Cache directory changes: Yes, Permanent: Yes
. 2010-06-23 12:02:49.619 DST mode: 1
. 2010-06-23 12:02:49.640 --------------------------------------------------------------------------
. 2010-06-23 12:02:49.690 Connecting to ftp.MyServer.com ...
. 2010-06-23 12:02:50.093 Connected with ftp.MyServer.com. Waiting for welcome message...
< 2010-06-23 12:02:50.324 220-
< 2010-06-23 12:02:50.742 220 MyServer FTP Server ready
> 2010-06-23 12:02:50.742 USER user
< 2010-06-23 12:02:50.966 331 Password required for user
> 2010-06-23 12:02:50.966 PASS *********
< 2010-06-23 12:02:51.333 230 User user logged in
> 2010-06-23 12:02:51.333 SYST
< 2010-06-23 12:02:51.552 215 UNIX Type: L8
> 2010-06-23 12:02:51.552 FEAT
< 2010-06-23 12:02:51.770 211-Features:
< 2010-06-23 12:02:51.771  MDTM
< 2010-06-23 12:02:51.771  MFMT
< 2010-06-23 12:02:51.771  MFF modify;UNIX.group;UNIX.mode;
< 2010-06-23 12:02:51.771  MLST modify*;perm*;size*;type*;unique*;UNIX.group*;UNIX.mode*;UNIX.owner*;
< 2010-06-23 12:02:51.771  REST STREAM
< 2010-06-23 12:02:51.771  SIZE
< 2010-06-23 12:02:52.192 211 End
. 2010-06-23 12:02:52.193 Connected
. 2010-06-23 12:02:52.193 --------------------------------------------------------------------------
. 2010-06-23 12:02:52.193 Using FTP protocol.
. 2010-06-23 12:02:52.193 Doing startup conversation with host.
> 2010-06-23 12:02:52.193 PWD
< 2010-06-23 12:02:52.420 257 "/" is the current directory
. 2010-06-23 12:02:52.421 Getting current directory name.
. 2010-06-23 12:02:52.421 Startup conversation with host finished.
. 2010-06-23 12:02:52.424 Collecting synchronization list for local directory 'G:\..\TestLocal\TestLocal' and remote directory 'Test', mode = 0, params = 2
. 2010-06-23 12:02:52.424 Retrieving directory listing...
> 2010-06-23 12:02:52.425 CWD /Test/
< 2010-06-23 12:02:52.679 250 CWD command successful
> 2010-06-23 12:02:52.679 PWD
< 2010-06-23 12:02:52.898 257 "/Test" is the current directory
> 2010-06-23 12:02:52.898 TYPE A
< 2010-06-23 12:02:53.117 200 Type set to A
> 2010-06-23 12:02:53.119 PORT 192,168,1,71,9,2
< 2010-06-23 12:02:53.539 200 PORT command successful
> 2010-06-23 12:02:53.539 LIST -a
< 2010-06-23 12:02:53.978 150 Opening ASCII mode data connection for file list
< 2010-06-23 12:02:54.394 226 Transfer complete
. 2010-06-23 12:02:54.394 Directory listing successful
. 2010-06-23 12:02:54.402 Synchronizing local directory 'G:\..\TestLocal\TestLocal\' with remote directory 'Test/', params = 2
. 2010-06-23 12:02:54.402 Copying 7 files/directories to remote directory "Test/"
. 2010-06-23 12:02:54.402   PrTime: Yes; PrRO: No; Rght: rw-r--r--; PrR: No (No); FnCs: N; RIC: 01; Resume: S (102400); CalcS: No; Mask: *.*
. 2010-06-23 12:02:54.402   TM: M; ClAr: No; CPS: 0; ExclM(No): 
. 2010-06-23 12:02:54.402   AscM: *.*html; *.htm; *.txt; *.php; *.php3; *.cgi; *.c; *.cpp; *.h; *.pas; *.bas; *.tex; *.pl; .htaccess; *.xtml; *.css; *.cfg; *.ini; *.sh; *.xml
. 2010-06-23 12:02:54.402 File: "G:\..\TestLocal\TestLocal\BuildExternal.proj"
. 2010-06-23 12:02:54.403 Copying "G:\..\TestLocal\TestLocal\BuildExternal.proj" to remote directory started.
. 2010-06-23 12:02:54.404 Binary transfer mode selected.
. 2010-06-23 12:02:54.404 Starting upload of G:\..\TestLocal\TestLocal\BuildExternal.proj
> 2010-06-23 12:02:54.404 TYPE I
< 2010-06-23 12:02:54.623 200 Type set to I
> 2010-06-23 12:02:54.625 PORT 192,168,1,71,9,3
< 2010-06-23 12:02:55.046 200 PORT command successful
> 2010-06-23 12:02:55.046 STOR BuildExternal.proj
< 2010-06-23 12:02:55.496 150 Opening BINARY mode data connection for BuildExternal.proj
< 2010-06-23 12:02:55.983 226 Transfer complete
> 2010-06-23 12:02:55.983 MFMT 20100316040921 BuildExternal.proj
< 2010-06-23 12:02:56.215 213 Modify=20100316040921; BuildExternal.proj
. 2010-06-23 12:02:56.215 Upload successful
. 2010-06-23 12:02:56.216 File: "G:\..\TestLocal\TestLocal\BuildProperties.proj"
. 2010-06-23 12:02:56.216 Copying "G:\..\TestLocal\TestLocal\BuildProperties.proj" to remote directory started.
. 2010-06-23 12:02:56.217 Binary transfer mode selected.
. 2010-06-23 12:02:56.217 Starting upload of G:\..\TestLocal\TestLocal\BuildProperties.proj
> 2010-06-23 12:02:56.217 TYPE I
< 2010-06-23 12:02:56.436 200 Type set to I
> 2010-06-23 12:02:56.438 PORT 192,168,1,71,9,4
< 2010-06-23 12:02:56.858 200 PORT command successful
> 2010-06-23 12:02:56.858 STOR BuildProperties.proj
< 2010-06-23 12:02:57.304 150 Opening BINARY mode data connection for BuildProperties.proj
< 2010-06-23 12:02:57.808 226 Transfer complete
> 2010-06-23 12:02:57.808 MFMT 20100614011150 BuildProperties.proj
< 2010-06-23 12:02:58.033 213 Modify=20100614011150; BuildProperties.proj
. 2010-06-23 12:02:58.033 Upload successful
. 2010-06-23 12:02:58.033 File: "G:\..\TestLocal\TestLocal\BuildPropertiesNew.proj"
. 2010-06-23 12:02:58.034 Copying "G:\..\TestLocal\TestLocal\BuildPropertiesNew.proj" to remote directory started.
. 2010-06-23 12:02:58.035 Binary transfer mode selected.
. 2010-06-23 12:02:58.035 Starting upload of G:\..\TestLocal\TestLocal\BuildPropertiesNew.proj
> 2010-06-23 12:02:58.035 TYPE I
< 2010-06-23 12:02:58.253 200 Type set to I
> 2010-06-23 12:02:58.254 PORT 192,168,1,71,9,5
< 2010-06-23 12:02:58.675 200 PORT command successful
> 2010-06-23 12:02:58.675 STOR BuildPropertiesNew.proj
< 2010-06-23 12:02:59.132 150 Opening BINARY mode data connection for BuildPropertiesNew.proj
< 2010-06-23 12:02:59.636 226 Transfer complete
> 2010-06-23 12:02:59.637 MFMT 20100414021220 BuildPropertiesNew.proj
< 2010-06-23 12:02:59.860 213 Modify=20100414021220; BuildPropertiesNew.proj
. 2010-06-23 12:02:59.860 Upload successful
. 2010-06-23 12:02:59.861 File: "G:\..\TestLocal\TestLocal\CreateCab.bat"
. 2010-06-23 12:02:59.861 Copying "G:\..\TestLocal\TestLocal\CreateCab.bat" to remote directory started.
. 2010-06-23 12:02:59.861 Binary transfer mode selected.
. 2010-06-23 12:02:59.862 Starting upload of G:\..\TestLocal\TestLocal\CreateCab.bat
> 2010-06-23 12:02:59.862 TYPE I
< 2010-06-23 12:03:00.081 200 Type set to I
> 2010-06-23 12:03:00.083 PORT 192,168,1,71,9,6
< 2010-06-23 12:03:00.502 200 PORT command successful
> 2010-06-23 12:03:00.502 STOR CreateCab.bat
< 2010-06-23 12:03:00.947 150 Opening BINARY mode data connection for CreateCab.bat
< 2010-06-23 12:03:01.372 226 Transfer complete
> 2010-06-23 12:03:01.372 MFMT 20100330024502 CreateCab.bat
< 2010-06-23 12:03:01.596 213 Modify=20100330024502; CreateCab.bat
. 2010-06-23 12:03:01.596 Upload successful
. 2010-06-23 12:03:01.597 File: "G:\..\TestLocal\TestLocal\Merlot.Aero.Build.suo"
. 2010-06-23 12:03:01.598 Copying "G:\..\TestLocal\TestLocal\Merlot.Aero.Build.suo" to remote directory started.
. 2010-06-23 12:03:01.598 Binary transfer mode selected.
. 2010-06-23 12:03:01.599 Starting upload of G:\..\TestLocal\TestLocal\Merlot.Aero.Build.suo
> 2010-06-23 12:03:01.599 TYPE I
< 2010-06-23 12:03:01.817 200 Type set to I
> 2010-06-23 12:03:01.819 PORT 192,168,1,71,9,8
< 2010-06-23 12:03:02.239 200 PORT command successful
> 2010-06-23 12:03:02.239 STOR Merlot.Aero.Build.suo
< 2010-06-23 12:03:02.683 150 Opening BINARY mode data connection for Merlot.Aero.Build.suo
< 2010-06-23 12:03:11.571 226 Transfer complete
> 2010-06-23 12:03:11.572 MFMT 20100416042915 Merlot.Aero.Build.suo
< 2010-06-23 12:03:11.794 213 Modify=20100416042915; Merlot.Aero.Build.suo
. 2010-06-23 12:03:11.794 Upload successful
. 2010-06-23 12:03:11.795 File: "G:\..\TestLocal\TestLocal\UI.msbuild"
. 2010-06-23 12:03:11.795 Copying "G:\..\TestLocal\TestLocal\UI.msbuild" to remote directory started.
. 2010-06-23 12:03:11.795 Binary transfer mode selected.
. 2010-06-23 12:03:11.796 Starting upload of G:\..\TestLocal\TestLocal\UI.msbuild
> 2010-06-23 12:03:11.796 TYPE I
< 2010-06-23 12:03:12.015 200 Type set to I
> 2010-06-23 12:03:12.016 PORT 192,168,1,71,9,10
< 2010-06-23 12:03:12.436 200 PORT command successful
> 2010-06-23 12:03:12.437 STOR UI.msbuild
< 2010-06-23 12:03:12.883 150 Opening BINARY mode data connection for UI.msbuild
< 2010-06-23 12:03:13.373 226 Transfer complete
> 2010-06-23 12:03:13.373 MFMT 20100312000656 UI.msbuild
< 2010-06-23 12:03:13.595 213 Modify=20100312000656; UI.msbuild
. 2010-06-23 12:03:13.595 Upload successful
. 2010-06-23 12:03:13.596 File: "G:\..\TestLocal\TestLocal\UITest.msbuild"
. 2010-06-23 12:03:13.597 Copying "G:\..\TestLocal\TestLocal\UITest.msbuild" to remote directory started.
. 2010-06-23 12:03:13.597 Binary transfer mode selected.
. 2010-06-23 12:03:13.597 Starting upload of G:\..\TestLocal\TestLocal\UITest.msbuild
> 2010-06-23 12:03:13.598 TYPE I
< 2010-06-23 12:03:13.816 200 Type set to I
> 2010-06-23 12:03:13.818 PORT 192,168,1,71,9,11
< 2010-06-23 12:03:14.239 200 PORT command successful
> 2010-06-23 12:03:14.239 STOR UITest.msbuild
< 2010-06-23 12:03:14.681 150 Opening BINARY mode data connection for UITest.msbuild
< 2010-06-23 12:03:15.097 226 Transfer complete
> 2010-06-23 12:03:15.098 MFMT 20100622222410 UITest.msbuild
< 2010-06-23 12:03:15.323 213 Modify=20100622222410; UITest.msbuild
. 2010-06-23 12:03:15.323 Upload successful
. 2010-06-23 12:03:15.327 Disconnected from server

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: synchronize always copies when criteria=time

WinSCP compares the timestamps as you see them in the file panels. Do they match there?

Reply with quote

Marcos
Guest

Re: synchronize always copies when criteria=time

Thanks! No they don't match. I can change the session time diff to get them to look the same in the UI. Can I do that in script as well?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
Location:
Prague, Czechia

Re: synchronize always copies when criteria=time

Please read:
How do I configure site, transfer and/or any other settings for which there are no script commands?
If that does not help, come back.

Edit 2023: The time difference is set as float, so it is not easy to set the correct value manually.
Easier is to configure everything in GUI and have it generate the code for you:
https://winscp.net/eng/docs/ui_generateurl#script
Though nowadays, you typically won't need to set the difference, as WinSCP should detect it.

Reply with quote

DanCooperstock
Joined:
Posts:
3
Location:
Toronto Canada

Re: synchronize and timezone

I'm having the same problems. I've read the FAQ, and it doesn't help, partly because I can't even find a setting in the GUI for setting the session timezone difference. Where is it hiding?

Reply with quote

Advertisement

DanCooperstock

Never mind. Although I'm still very puzzled about how to make this work with FTP, whether in the GUI or in scripting, all problems seem to go away when I use SFTP instead, which fortunately is available on my server.

Reply with quote

DanCooperstock
Joined:
Posts:
3
Location:
Toronto Canada

Even having found the timezone offset setting in the GUI, I can't get it to work right in the GUI under FTP. At best, I can get the local and remote times to match by setting an offset that I don't really think is correct, but even then they don't really match.

For instance, I'm looking at a file that was transferred by synchronize under SFTP (and shows as the same date and same time to the second under SFTP). The local time (and remote time under SFTP) is 14:34:19. But when I switch to FTP, the remote time shows as 14:33. So obviously synchronize based on time would re-copy it. Perhaps this is a limitation of the FTP server on my server.

In any case, at this point since sftp is working perfectly for me, this is pretty much academic. Thank you.

Reply with quote

Advertisement

You can post new topics in this forum