Automatic download of data from an ftp address

1

Could someone please help me download data from a ftp every time I log into my machine (linux mint) using a shell script? I've tried countless times, but to no avail. I'll show you the attempts and their 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'

    
asked by anonymous 11.02.2017 / 09:32

1 answer

3

You're putting the URL in place of the username. Note that the URL is repeated. If you used variable substitution, pos the wrong variable. In addition, URL building is in fact wrong.

Instead of this:

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

The correct would be for a URL scheme with username and password:

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

Better yet:

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