Automatic download of data from an ftp address

Asked

Viewed 282 times

1

Could someone please help me to download data that is found on an ftp whenever I log into my machine (linux Mint) using a shell script? I have tried numerous times, but without success. Asseguir I will show the attempts and the respective errors.

wget ftp://41.94.65.2:[email protected]/CHIBABAVA/data/2017/01/CHIBABAVA_data20170101.csv -P ~/Downloads

Error:

Resolving ftp.41.94.65.2 (ftp.41.94.65.2)... failed: Name or service not known. wget: Unable to resolve host address ːftp.41.94.65.2'

1 answer

3

You are putting the URL in place of the username. Note that the URL is repeated. If you used variable substitution, you put the wrong variable. Also, the actual URL construction is wrong.

Instead:

ftp://41.94.65.2:[email protected]...
^^^^^^^^^^^^^^^^       ^^^^
aqui é o usuário       aqui é o protocolo

The correct would be this for a URL schema with user and password:

USUARIO:SENHA@ftp://41.94.65.2...

Even better:

wget --user=USUARIO --password=SENHA ftp://41.94.65.2...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.