Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

genTaliaru

this topis was started with FTP sync problem not SCP

this topis was started with FTP sync problem not SCP
jstein

Time format

Thanks for the link. I can see that transferring local changes without looking at the server would be a quite different approach.

Regarding the list command, I tried using "ls -laT" but note that the time format from my server is "MonthShortName Day Time Year" (and the server doesn't understand the --full-time switch).

I haven't worked much on the project the last days, but I wrote a short PHP-script to list files with the right timestamp in long format, which seems to do the work.

The script is quite limited, but if anyone can use it, please feel free:

#!/usr/local/bin/php -d safe_mode=off

<?php

/*

Used to create a directory list with timestamps, that can be
used with WinSCP synchronization functions.

Note that file permissions are allways reported as rw-rw-r--, timezone is hardcoded and
only dirs and links are detected - all other entries are regarded as normal files.

*/

$path = getcwd();
for ($i=1;$i<$argc;$i++) if (substr($argv[$i], 0, 1) != '-') $path = $argv[$i];
//echo("Path: $path\r\n");
$files = scandir($path);

foreach ($files as $file) {
  $info = stat($path.'/'.$file);
  $user = posix_getpwuid($info['uid']);
  $group = posix_getgrgid($info['gid']);
  $perms = fileperms($path.'/'.$file);
  if (is_dir($file)) echo('d');
  else if (is_link($file)) echo('l');
  else echo('-');
  printf("rw-rw-r--  %10d %10s %10s %10s %s %s\n", $info['ino'], $user['name'], $group['name'], 1*$info[7], date('Y-m-d H:i:s', $info[9]).'.000000000 +0200', $file);
}
martin

Re: Me too...

jstein wrote:

Yes, it's definitely a time synchronization problem when using SCP.

I replaced the listing command (ls -la) with a small perl hack, that always shows the date as 2008-01-01 and now all files are allways uploaded when a change occur.

The remote system is running tcsh on FreeBSD, and the output of "ls -la" is in the format:
-rw-r--r-- 1 user group 1214 Aug 5 15:15 index.php

While "ls -laT" is in the format:
-rw-r--r-- 1 user group 1214 Aug 5 15:15:16 2008 index.php

And my "fake" list output is:
-rw-r--r-- 1 user group 1214 2008-01-01 00:00:00.000000000 +0200 index.php

In the latest WinSCP version you can change the listing command in session options. So you can set it to "ls -laT". BTW WinSCP tried using --full-time switch. It does not work on your system?
martin

Re: Me too...

jstein wrote:

This is most likely caused by synchronization problems, but my thought was: Why synchronize at all?

If the local and remote directory has initially been synchronized, why not just transfer the file anytime a change is detected in the local directory?

This is explained in documentation.
jstein

Re: Me too...

Yes, it's definitely a time synchronization problem when using SCP.

I replaced the listing command (ls -la) with a small perl hack, that always shows the date as 2008-01-01 and now all files are allways uploaded when a change occur.

The remote system is running tcsh on FreeBSD, and the output of "ls -la" is in the format:
-rw-r--r-- 1 user group 1214 Aug 5 15:15 index.php

While "ls -laT" is in the format:
-rw-r--r-- 1 user group 1214 Aug 5 15:15:16 2008 index.php

And my "fake" list output is:
-rw-r--r-- 1 user group 1214 2008-01-01 00:00:00.000000000 +0200 index.php

Regards

Jonathan
jstein

Re: Me too...

Thanks for your reply.

This is most likely caused by synchronization problems, but my thought was: Why synchronize at all?

If the local and remote directory has initially been synchronized, why not just transfer the file anytime a change is detected in the local directory?

(This should probably be an option - some users might not like newer remote files to be overwritten).

Regards

Jonathan
martin

Re: Me too...

Please read FAQ. If that does not help, come back.
jstein

Me too...

I didn't watch the video, but it sounds like I have the same problem with WinSCP 4.1.6 (using the SCP-protocol).

It looks like there are some network activity, even though the file is not uploaded. Does WinSCP try to detect if the local and remote files are actually different?
- And if so, is there an option to force WinSCP to upload without checking?

Regards

Jonathan
martin

Re: "Keep remote directory..." not working. Video attached

Thanks for your post. This issue has been added to tracker.
genTaliaru

yes i have the exact same problem

In version 4.1.6 with FTP i have this problem.
I have to keep direcory up to date in many FTP serversi. But every where is the same problem.


But if i use SSH protocol it works fine
theJcord

"Keep remote directory..." not working. Video attached

Hello,

Maybe someone can tell me what I'm doing wrong here... When I try to keep the remote directory up to date, it works on the first sync, but never on future changes to files.

I made a short video to show what I mean:

http://216.180.232.104/winscp.avi