shell script to download files from remote machine using ftp shell script to download files from remote machine using ftp shell shell

shell script to download files from remote machine using ftp


It would be much simpler with wget:

wget ftp://name:123@ftp.flowers.com/flower/rose/red


Hi all its already too late and you might have resolved your issue by now. But anyhow i would like to know if you have had resolved it with any other alternative method:

I've noticed minor change in this below script which you have given, well i guess it is the "/" which is you are missing after the location "cd /flower/rose"

ftp -in ftp.flowers.com << SCRIPTENDuser name 123binarycd /flower/rose/mget redSCRIPTEND


wget --user=name --password=123 ftp://ftp.flowers.com/flower/rose/red

To download to a different directory than the current directory:

wget --user=name --password=123 directory-prefix=/the/target/directory/ ftp://ftp.flowers.com/flower/rose/red

Then the files will be downloaded to /the/target/directory/ .

If you know the name of the file ahead of time, you can use the -O option to wget to tell it where to write the file:

wget --user=name --password=123 --output-document=/the/target/directory/red ftp://ftp.flowers.com/flower/rose/red