Hello,
I use lftp's reverse mirror function to synchronise a local build of a
Web site with a Web hosting company's FTP server.
The Web site is built using Apache Forrest. Each time I make a change
to the Web site source files (the input to Forrest), I run Forrest
again to rebuild a complete, static HTML copy of the Web site. Then I
use lftp to synchronise this local build with the public (production)
Web site via FTP.
I use a Bash script to run lftp with different arguments, depending on
which Web site I am updating. Here is the line from my Bash script
that runs lftp:
lftp -e "mirror -Rv --ignore-time build/site/ /${ftp_path}; exit" ${ftp_uri}
I need the --ignore-time option because otherwise lftp uploads Web
pages that have not been changed since the last Forrest build. This
is because Forrest rebuilds all pages in the site each time, so all
generated HTML files in a build have the current time as the last
modification time.
This seemed to work fine until today, when I encountered an unusual situation:
I swapped numbers between two table cells on a page, which did not
change the size of the Forrest source file nor the generated HTML
file.
Now the problem is that lftp does not upload the generated HTML file,
because the size of the local file is the same as the remote file.
Because I am using --ignore-time, the local file does not get
uploaded, even though it is newer than the remote file.
What can I do?
Is there a way to tell lftp to take more than the file size into
consideration when deciding which local files need to be uploaded,
since I have to ignore last modification times of local files?
I can unconditionally upload all local files, but this is inefficient.
Furthermore, I may not realise that I need to do this.
In this case, I noticed that lftp was not uploading my changed local
file because I changed only this single page in my Web site. If I had
made many changes to my Web site, I might not notice that the size of
one of the generated HTML files did not change since the last build.
Consequently, I would not notice that lftp was not uploading this
file. Then my public Web site would be outdated and I would be
unaware.
I am using a prebuilt Debian package of lftp v3.5.11 on an i686 Linux
PC. This is the newest version of lftp I could install from my list
of Debian sources. I was using v3.5.10 until today, when I upgraded
to v3.5.11 because the news page says that v3.5.11 fixed a mirroring
issue. The upgrade does not seem to have changed my problem
behaviour, though.
Thanks,
Brolin