lftp mirror -n does not work

Project:lftp (project)
Component:Documentation
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Project wiki:lftp
Related pages:#175: lftp
Description

lftp mirror -n does not work

See:
http://www.mail-archive.com/lftp@uniyar.ac.ru/msg04029.html

It seems it was already reported (??):
http://www.mail-archive.com/lftp-devel@uniyar.ac.ru/msg01605.html

Comments

#1

NEWS:

Version 0.14.0 - 1998-01-28
* reverse mirror (--reverse) (limited - no symlinks, no timestamps)

That's old, but has it been fixed??
That's precisely my problem.

#2

check:
src/MirrorJob.cc

only-newer
'n'
ONLY_NEWER

#3

Project:Linux software» lftp (project)

#4

$ date '+%s'
1322097794

#5

ftp:timezone (string)
Assume this timezone for time in listings returned by LIST command. This setting can be GMT offset [+|-]HH[:MM[:SS]] or any valid TZ value (e.g. Europe/Moscow or
MSK-3MSD,M3.5.0,M10.5.0/3). The default is GMT. Set it to an empty value to assume local timezone specified by environment variable TZ.

#7

http://winscp.net/eng/docs/ui_login_environment
"The option is not available with SFTP protocol, as with it, the server must report all timestamps in UTC."

#8

http://en.wikipedia.org/wiki/SSH_File_Transfer_Protocol
http://tools.ietf.org/html/draft-ietf-secsh-filexfer-13

7.7. Times
All times are represented as seconds from Jan 1, 1970 in UTC. A
negative value indicates number of seconds before Jan 1, 1970.

#9

Here is what I did at 17:18 GMT+8, i.e. 09:18GMT:

$ date '+%s' && touch apple
1322212715
$ ll
total 8.0K
-rw-r--r-- 1 overshoot adm  0 2011-11-25 17:18 apple

// Did lftp mirror -R
lftp user@ftp.example.net:/test> ll
drwxr-xr-x    2 1030     clients       512 Nov 25 10:19 .
drwx---r-x    6 1030     clients       512 Nov 25 03:41 ..
-rw-r--r--    1 1030     clients         0 Nov 25 09:18 apple

// Observed timestamps:
fi->date.ts_prec: 0
date: 1322212715
fi->date: 1322209115
labs(date-fi->date: 3600

#10

$ date -d @1322212715 --rfc-2822
Fri, 25 Nov 2011 17:18:35 +0800
$ date -d @1322209115 --rfc-2822
Fri, 25 Nov 2011 16:18:35 +0800

#11

Using
set ftp:timezone +1
does not help.
I observe the same behavior and the same timestamps.

I used it in .lftprc
and I also tried live:

:/test> ll
drwxr-xr-x    2 1030     clients       512 Nov 25 10:37 .
drwx---r-x    6 1030     clients       512 Nov 25 03:41 ..
-rw-r--r--    1 1030     clients         0 Nov 25 09:18 apple
:/test> set ftp:timezone +2
:/test> ll
drwxr-xr-x    2 1030     clients       512 Nov 25 10:37 .
drwx---r-x    6 1030     clients       512 Nov 25 03:41 ..
-rw-r--r--    1 1030     clients         0 Nov 25 09:18 apple

#12