7

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 setup 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? Thanks in advance

Chris
  • 71
  • 1
  • 1
  • 2

1 Answers1

14

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.

DerfK
  • 19,493
  • 2
  • 38
  • 54
  • 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 name@name.com,password ftp.name.com xfer:clobber on mget * – Chris Oct 29 '10 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 '10 at 20:03
  • 1
    Just a warning. This deletes the file if the transfer does not work such as if file permissions. – maxisme Apr 18 '17 at 20:53