File size decreases when synchronizing folders with a sftp account using lftp.

Solution Verified - Updated -

Issue

  • File size decreases when synchronizing folders with a sftp account using lftp.

  • It's reproducible by following the steps below:

# lftp -e "mirror -e -vvv sftp://<USERNAME>:<PASSWD>@<SRCHOST>/<SRC PATH>/ sfftp://<USERNAME>:<PASSWD>@<DESTHOST>/<DEST PATH>/"

1. 800 files exist in <SRC PATH>.
2. <DEST PATH> is empty. 
3. Run above mentioned command (lftp -e ~~~) to synchronize the 2 folders, <SRC PATH> and <DEST PATH>.
4. Issue occurs. File size decreases on the below listed 10 image files of total files (800 files in total) as shown below:

+----------+---------------+--------------------+-----------+
| File     | Original size | Mirrored file size | File type |
+----------+---------------+--------------------+-----------+
|        A |    108,971    |      98,304        |   .png    |
|        B |    110,294    |      98,304        |   .jpg    |
|        C |    127,948    |      98,304        |   .png    |
|        D |     99,510    |      98,304        |   .gif    |
|        E |    123,354    |      98,304        |   .jpg    |
|        F |    115,235    |      98,304        |   .jpg    |
|        G |    123,774    |      98,304        |   .jpg    |
|        H |    106,865    |      98,304        |   .jpg    |
|        I |    108,078    |      98,304        |   .jpg    |
|        J |    120,619    |      98,304        |    .js    |
+----------+---------------+--------------------+-----------+
  • The issue occurs only when either or is NFS mounted directory.

  • Issue does not occur when both and are directories sitting on the local filesystem

Environment

  • Red Hat Enterprise Linux 7 (kernel-3.10.0-229.el7)
  • openssh-6.6.1p1-25.el7_2
  • lftp-4.4.8-7.el7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content