lftp reverse mirror silently skips files in subfolders

Project:lftp (project)
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Project wiki:lftp
Related pages:#175: lftp
Tags:cygwin, lftp, mirror
Description

I'm using lftp (through cygwin) to push content to an ftp-only web-server. It works intermittently to upload (reverse mirror) files to a server.

Any idea why this would occasionally skip files changed in a subfolder, but not skip files changed in the home directory?

Details: I'm using the reverse mirror mode, which recursively pushes a local folder up to the server instead of downloading it from the server. Throughout the web, this is the recommended option for recursive upload.

Here's the full script I'm using...

#!/bin/bash
HOST="..."
USER="..."
PASS="..."
FTPURL="ftp://$USER:$PASS@$HOST"
LCD="/local/directory"
#RCD=""
#RCDCMD=cd $RCD;
#DELETE="--delete"
lftp -c "set ftp:ssl-allow no;
set ftp:list-options -a;
open '$FTPURL';
lcd $LCD;
$RCDCMD \
mirror --reverse \
$DELETE \
--verbose \
--exclude-glob .*swp \
--exclude-glob .*swn \
--exclude-glob .*swo"

The lftp seems to work intermittently. For example, I will run the command twice, and it skips the changes, then the third time it works, correctly copying the changed files up to the server.

If I run an ls -R (as suggested by a stackoverflow user), the upload always works successfully.

Comments

#1

Related pages:+175: lftp

#2

I think that this is by design.

The mirror function only mirrors one single directory, unless you add the recursive option, in which case all sub directories are included in the mirroring process.

What is the exact lftp command issued.
Add to it the debug (verbose) option and see what the output says.