2

I'm running into an issue that's perplexing to me. I'm using LFTP as part of a nightly automated file transfer process, with the goal of collecting all of the .csv files on a site.

Generally, the mget command, coupled with a wildcard .csv is able to find and download the files I expect it to. However, I'm running into an interesting situation where I have a file, which is identified with ls as:

-rw-------   0 User Name -         6461 Oct  4 14:04 file name.csv

but when I run mget *.csv, I get the following error message:

mget: Access failed: 550 /path/to/file/4 14:04 file name.csv: No such file or directory.

It looks like it's appending the %d %h:%m portion of the file's metadata to the file name when trying to mget it. I've thought it might be due to spaces in the file name, but in a testing it it doesn't look like that's the case.

Summary

  • The file exists, as checked by ls
  • The file should be captured by the mget command
  • The file is not captured by the mget command because somewhere along the line between the search and get commands, additional characters get added to the front of the file name, causing it to try to get a file that doesn't exist

Any thoughts on what I am doing wrong?

Adam Bethke
  • 1,028
  • 2
  • 19
  • 35

3 Answers3

0

The answer to this question ends up being server and version specific, but I'll share what ended up being the problem in case it leads to someone else not having a trove of problems in the future.

FTP servers have different mechanisms for escaping users' names. In this case, the operations user account had a two part first name, with space separation.

The way(s) in which the FTP server do (or do not) escape user names can lead to everything being thrown off a column by the regex parser for mget in lftp. Reducing the username to a value which was compliant with lftp's expectations (appears to be one word, can include _ and -) ended up resolving this problem.

Adam Bethke
  • 1,028
  • 2
  • 19
  • 35
0

In order to use wildcards with lftp you need to specify the full path to the files. When trying to download from the EBI FTP server the following will not work

lftp -c 'open ftp.ebi.ac.uk; set xfer:clobber on;  lcd /export/data/blastdb/temp/ ; mget nr*.tar.gz

Adding the path with your mget call allows the wildcard expansion and works as one would expect..

lftp -c 'open ftp.ebi.ac.uk; set xfer:clobber on;  lcd /export/data/blastdb/temp/ ; mget /pub/blast/db/nr*.tar.gz
Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
0

Maybe you are not in the correct directory or you misspelled the file. You can brute force and download the whole arborescence with the command :

lftp> mirror .

By the way, your error might be that there is a space in the name of your file.

lftp> mget file\ name.csv

Although, the wildcard should expand correctly the space with \_space

douardo
  • 697
  • 6
  • 6