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

Author Message
theJcord

Guest


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
Advertisements
genTaliaru
[View user's profile]

Joined: 2008-09-16
Posts: 3
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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Thanks for your post. This issue has been added to tracker.
_________________
Martin Prikryl
jstein

Guest


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
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Please read FAQ. If that does not help, come back.
_________________
Martin Prikryl
jstein

Guest


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
jstein

Guest


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
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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 Prikryl
jstein

Guest


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:

Code:
#!/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);
}
genTaliaru
[View user's profile]

Joined: 2008-09-16
Posts: 3
this topis was started with FTP sync problem not SCP
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License