lavv17 / lftp

sophisticated command line file transfer program (ftp, http, sftp, fish, torrent)
http://lftp.yar.ru
GNU General Public License v3.0
1.08k stars 159 forks source link

the options "-c" and "-e" of mirror are incompatible #658

Open adb014 opened 2 years ago

adb014 commented 2 years ago

I have a directory where the current user has write permission, but needs to overwrite a file owned by someone else. I use something like

lftp -c "open sftp://user:@host/Dir; mirror --delete-first -e -c -O /local/dir"

However this fails with the error "mirror /local/dir/badfile: Permission denied". Testing with the "-vvv" option I see that the old file is not removed before the transfer. Removing the "-c" flag I see

lftp -c "open sftp://user:@host/Dir; mirror --vvv --delete-first -e  -O /local/dir"
Removing old file 'badfile'
Transferring file 'badfile'
Finished transfer 'badfile' (XXX B/s)

This is with lftp version 4.9.2.