Discussion:
Overwriting with 'put -c' command
Arnaud Rébillout
2013-11-15 09:47:51 UTC
Permalink
Hello,

when doing some tests with lftp, I found a strange behavior with the
'put -c' command.

If I want to copy a file to a FTP server, and the file already exists,
it seems that the file is copied only if the source is bigger than the
destination.
Is it the expected behavior ?

Here is my test:

# Client side
$ echo "abcd" > /tmp/test.txt
$ lftp -c "open 'ftp://test:***@192.168.3.55'; put -c /tmp/test.txt"
# Server side
$ cat test.txt
abcd

# Client side
$ echo "abcdefgh" > /tmp/test.txt
$ lftp -c "open 'ftp://test:***@192.168.3.55'; put -c /tmp/test.txt"
# Server side
$ cat test.txt
abcdefgh

# Client side
$ echo "xyz" > /tmp/test.txt
$ lftp -c "open 'ftp://test:***@192.168.3.55'; put -c /tmp/test.txt"
# Server side - file has not been modified !
$ cat test.txt
abcdefgh


Best regards,
Arnaud Rébillout
Alexander V. Lukyanov
2013-11-15 10:25:19 UTC
Permalink
Post by Arnaud Rébillout
when doing some tests with lftp, I found a strange behavior with the
'put -c' command.
If I want to copy a file to a FTP server, and the file already
exists, it seems that the file is copied only if the source is
bigger than the destination.
Is it the expected behavior ?
Yes. put -c is meant for transfer resume. If target file is larger than
the source file, then the transfer cannot be resumed.
--
Alexander.
Arnaud Rébillout
2013-11-15 11:46:53 UTC
Permalink
Post by Alexander V. Lukyanov
Yes. put -c is meant for transfer resume. If target file is larger than
the source file, then the transfer cannot be resumed.
Thanks for the clarification, I didn't understand it that way when
reading quickly the man page.

Best regards
Arnaud Rébillout

Loading...