5

I am using lftp for mirroring the files on a server to a PC. The problem for me is that as I put a batch of files on the PC that are exactly the same as the ones on the server, the mirroring starts of all files. Probably due to differing time stamps? That is a problem since the mirroring is only intended to change some files I may change, not all (a massive number of files).

What I want is that lftp: 1. Updates the PC with new files that are put on the server 2. Deletes any file on the PC that is no longer on the server 3. (and here the problem comes) Files that exist on the PC and the server, should only be updated on the PC if there is a difference in file size (ignoring any potential time stamp difference) This is how the command looks like right now:

LCD="/home/administrator/files"
RCD=""
lftp -c "ser ftp:list-options -a;
open ftp://$username:$pw@$host;
lcd $LCD;
cd $RCD;
mirror --delete"

what should i add/change? Thanks in advance. /Toby

  • I was reading an outdated manual, now I found the option: --ignore-time I tested it and it was exactly what I wanted. –  Sep 14 '11 at 12:40
  • 1
    Then you should answer your own question and accept your answer so that the circle is closed (you might need to wait some time till you can do that though) –  Sep 14 '11 at 12:45
  • 1
    While I'm glad your problem is solved, tools such as `rsync(1)` or `git(1)` can do this job far better than `lftp(1)` -- not every update to a file will change the file size, and your `lftp(1)` process will miss those. And when files _are_ updated, many types are modified in a way that `rsync(1)` or `git(1)` can modify in place, rather than transfer completely from scratch. – sarnold Sep 15 '11 at 01:35

1 Answers1

4

I was reading an outdated manual, now I found the option: --ignore-time I tested it and it was exactly what I wanted.

Toby
  • 43
  • 2
  • 1
    sarnold, I could not use rsync or git since there was some requirements they did not support (I think it was that I had to log in to an ftp account, but it could also been something else) – Toby Sep 15 '11 at 09:20