8

I am getting this: mget: filename.xlsx: file already exists and xfer:clobber is unset error when I try to download the contents of my FTP server.

Basically it is set up using Cygwin. We recently upgraded the server where all of the data is downloaded to on a set schedule. The old server was Windows server 2003, and the new server is Windows Server 2008.

I am having issues when I try to download a file that is already in the folder. The client never changes the file name, so when we go to download it from the server we get that error.

Is there anything I can put in the batch files, or something for it to just force it to replace that file?

1 Answer 1

16

xfer:clobber is the setting in lftp that decides whether or not to allow mget to replace files. Add

set xfer:clobber on

to your lftp script so that it's set, then the mget command should replace the file.

3
  • I am getting the same error and then below it says Unknown command 'xfer:clobber' I set this in the upload.lftp that was located in the directory where the files are being saved to. My upload.lftp file looks like this: open -u [email protected],password ftp.name.com xfer:clobber on mget *
    – Chris
    Oct 29, 2010 at 15:09
  • @Chris You need set xfer:clobber on. The choice of serverfault to break the line in the middle of the command was unfortunate.
    – DerfK
    Oct 29, 2010 at 20:03
  • 2
    Just a warning. This deletes the file if the transfer does not work such as if file permissions.
    – maxisme
    Apr 18, 2017 at 20:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .