Re: Bug in lftp mirror when using xfer:use-temp-file option

akshay gupta <[email protected]> Mon, 27 Oct 2014 13:30:42 +0530
Newsgroups gmane.network.lftp.user,gmane.network.lftp.devel
Message-ID <CAB_qc71AaXhqXFx0+Pds2FTpUdKArpcqOkrMA9fu9T3dCxAXYQ@mail.gmail.com>
--===============6050927826610498723==
Content-Type: multipart/alternative; boundary=047d7b450e068ae5c2050662eecc

--047d7b450e068ae5c2050662eecc
Content-Type: text/plain; charset=UTF-8

Here are the debug logs test.txt is the file that is changed:

lftp [email protected]:~/Desktop/lftp> mirror
---> TYPE A
<--- 200 Type set to A.
---> PASV
<--- 227 Entering Passive Mode (192,168,128,124,228,174)
---- Connecting data socket to (192.168.128.124) port 58542
---- Data connection established
---> LIST
<--- 150 Opening ASCII mode data connection for '/bin/ls'.
---- Got EOF on data connection
---- Closing data socket
<--- 226 Transfer complete.
---> TYPE I
<--- 200 Type set to I.
---> MDTM .DS_Store
<--- 213 20141027064918
---> MDTM search-2.html
<--- 213 20140811111726
---> MDTM search-3.html
<--- 213 20140811111744
---> MDTM search-4.html
<--- 213 20140811111745
---> MDTM search.html
<--- 213 20140811111722
---> MDTM settings.xml
<--- 213 20140820095244
---> MDTM test.txt
<--- 213 20141027075438
---> PASV
<--- 227 Entering Passive Mode (192,168,128,124,228,176)
---- Connecting data socket to (192.168.128.124) port 58544
---- Data connection established
---> RETR test.txt
<--- 150 Opening BINARY mode data connection for 'test.txt' (202 bytes).
---- Got EOF on data connection
---- Closing data socket
<--- 226 Transfer complete.
Total: 1 directory, 7 files, 0 symlinks
Modified: 1 file, 0 symlinks
202 bytes transferred
To be removed: 0 directories, 1 file, 0 symlinks
---- Closing idle connection
---> QUIT
**** Timeout - reconnecting
<--- 221-
<---     Data traffic for this session was 172301 bytes in 7 files.
<---     Total traffic for this session was 181339 bytes in 13 transfers.
<--- 221 Thank you for using the FTP service on 192.168.128.124.
---- Closing control socket


~Akshay

On Mon, Oct 27, 2014 at 1:18 PM, Alexander Lukyanov <[email protected]>
wrote:

> Can you provide a debug log? Why lftp cannot replace the old file?
>
> 2014-10-27 10:44 GMT+03:00 akshay gupta <[email protected]>:
>
>> Hi,
>>
>> I am trying to mirror files using lftp, I have tested a use case where a
>> file at the source machine gets modified but the file name remains the
>> same. After mirroring, lftp is unable to replace the old file and also
>> leaves a temporary file.
>>
>> For example. If source have file a.txt and its mirrored successfully at
>> the destination, now if I update a.txt append some content and save it with
>> same name. If I run lftp mirror again then its not able to replace the
>> existing a.txt but it also leaves the temp file a.txt_transit_ behind. And
>> if i run the mirror multiple times it always downloads the changed a.txt, i
>> can see this from the lftp logs.
>>
>> Suggestion: Will it make sense to keep versions of the files as they are
>> updated at the source. Like if a.txt is changed at source then lftp mirror
>> will save it as a.txt_{TIMESTAMP}_. Every time a file is updated it will be
>> saved with a new time stamp. And mirror will consider these file to decide
>> whether to download or not.
>>
>>
>> Thanks,
>> Akshay
>>
>>
>>
>>
>>
>
>
> --
>    Alexander.
>

--047d7b450e068ae5c2050662eecc
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Here are the debug logs test.txt is the file that is chang=
ed:<br><br>lftp [email protected]:~/Desktop/lftp&gt; mirror<br>--=
-&gt; TYPE A<br>&lt;--- 200 Type set to A.<br>---&gt; PASV<br>&lt;--- 227 E=
ntering Passive Mode (192,168,128,124,228,174)<br>---- Connecting data sock=
et to (192.168.128.124) port 58542<br>---- Data connection established<br>-=
--&gt; LIST<br>&lt;--- 150 Opening ASCII mode data connection for &#39;/bin=
/ls&#39;.<br>---- Got EOF on data connection<br>---- Closing data socket<br=
>&lt;--- 226 Transfer complete.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
 <br>---&gt; TYPE I<br>&lt;--- 200 Type set to I.<br>---&gt; MDTM .DS_Store=
<br>&lt;--- 213 20141027064918<br>---&gt; MDTM search-2.html<br>&lt;--- 213=
 20140811111726<br>---&gt; MDTM search-3.html<br>&lt;--- 213 20140811111744=
<br>---&gt; MDTM search-4.html<br>&lt;--- 213 20140811111745<br>---&gt; MDT=
M search.html<br>&lt;--- 213 20140811111722<br>---&gt; MDTM settings.xml<br=
>&lt;--- 213 20140820095244<br>---&gt; MDTM test.txt<br>&lt;--- 213 2014102=
7075438<br>---&gt; PASV<br>&lt;--- 227 Entering Passive Mode (192,168,128,1=
24,228,176)<br>---- Connecting data socket to (192.168.128.124) port 58544<=
br>---- Data connection established<br>---&gt; RETR test.txt<br>&lt;--- 150=
 Opening BINARY mode data connection for &#39;test.txt&#39; (202 bytes).<br=
>---- Got EOF on data connection<br>---- Closing data socket<br>&lt;--- 226=
 Transfer complete.=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <br>Tota=
l: 1 directory, 7 files, 0 symlinks<br>Modified: 1 file, 0 symlinks<br>202 =
bytes transferred<br>To be removed: 0 directories, 1 file, 0 symlinks<br>--=
-- Closing idle connection<br>---&gt; QUIT<br>**** Timeout - reconnecting<b=
r>&lt;--- 221-<br>&lt;---=C2=A0=C2=A0=C2=A0=C2=A0 Data traffic for this ses=
sion was 172301 bytes in 7 files.<br>&lt;---=C2=A0=C2=A0=C2=A0=C2=A0 Total =
traffic for this session was 181339 bytes in 13 transfers.<br>&lt;--- 221 T=
hank you for using the FTP service on 192.168.128.124.<br>---- Closing cont=
rol socket<br><br><div class=3D"gmail_extra"><br></div><div class=3D"gmail_=
extra">~Akshay<br></div><div class=3D"gmail_extra"><br><div class=3D"gmail_=
quote">On Mon, Oct 27, 2014 at 1:18 PM, Alexander Lukyanov <span dir=3D"ltr=
">&lt;<a href=3D"mailto:[email protected]" target=3D"_blank">lavv17f@gmail.=
com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
">Can you provide a debug log? Why lftp cannot replace the old file?<br></d=
iv><div class=3D"gmail_extra"><div><div class=3D"h5"><br><div class=3D"gmai=
l_quote">2014-10-27 10:44 GMT+03:00 akshay gupta <span dir=3D"ltr">&lt;<a h=
ref=3D"mailto:[email protected]" target=3D"_blank">akshaygupta202@gm=
ail.com</a>&gt;</span>:<br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
Hi,<div><br></div><div>I am trying to mirror files using lftp, I have teste=
d a use case where a file at the source machine gets modified but the file =
name remains the same. After mirroring, lftp is unable to replace the old f=
ile and also leaves a temporary file.</div><div><br></div><div>For example.=
 If source have file a.txt and its mirrored successfully at the destination=
, now if I update a.txt append some content and save it with same name. If =
I run lftp mirror again then its not able to replace the existing a.txt but=
 it also leaves the temp file a.txt_transit_ behind. And if i run the mirro=
r multiple times it always downloads the changed a.txt, i can see this from=
 the lftp logs.</div><div><br></div><div>Suggestion: Will it make sense to =
keep versions of the files as they are updated at the source. Like if a.txt=
 is changed at source then lftp mirror will save it as a.txt_{TIMESTAMP}_. =
Every time a file is updated it will be saved with a new time stamp. And mi=
rror will consider these file to decide whether to download or not.</div><d=
iv><br></div><div><br></div><div>Thanks,</div><div>Akshay</div><div><br></d=
iv><div><br></div><div><br></div><div><br></div></div>
</blockquote></div><br><br clear=3D"all"><br></div></div><span class=3D"HOE=
nZb"><font color=3D"#888888">-- <br><div dir=3D"ltr"><div></div>=C2=A0=C2=
=A0 Alexander.<br></div>
</font></span></div>
</blockquote></div><br></div></div>

--047d7b450e068ae5c2050662eecc--

--===============6050927826610498723==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
lftp mailing list
[email protected]
http://univ.uniyar.ac.ru/mailman/listinfo/lftp

--===============6050927826610498723==--