I have
host name : "ftp.flowers.com"
username : "name"
password : "123"
directory path : "/flower/rose"
from which I have to download "red" file. the following script is not working
ftp -in ftp.flowers.com << SCRIPTEND
user name 123
binary
cd /flower/rose
mget red
SCRIPTEND
It would be much simpler with wget
:
wget ftp://name:[email protected]/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 << SCRIPTEND
user name 123
binary
cd /flower/rose/
mget red
SCRIPTEND
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With