Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am new to Linux, i want to write the perl script to download the files from FTP sites but here i want to use curl command to download the files. which is working fine in wget command but not working with curl command.

The below coommand is downloading the file from SFTP servers, Here i have mentioned the SFTP username/password mentioned in the wgetrc_proxy file and mentioned the directory path where to download the DATA.zip(/hom1/sara/) in the my linux box.

WGETRC=/hom1/sara/wgetrc_proxy wget --directory-prefix=/hom1/sara/ ftp://67.125.134.122/out_files/DATA.ZIP

I tried the same scenario using CURL, but which is not working.

WGETRC=/hom1/sara/wgetrc_proxy curl --directory-prefix=/hom1/sara/ ftp://67.125.134.122/out_files/DATA.ZIP

wgetrc_proxy contains below things.

-sh-3.00$ cat wgetrc_proxy
netrc = off

login=aaaa
passwd=xxxx

dot_style=mega
timeout=180

What mistake i have done here, else missed any environment configuration. Please help me out to resolve this issue.

share|improve this question

1 Answer 1

curl doesn't support a wgetrc file or the same command line options as wget. Use man curl to get the complete list of available options.

This should do:

cd /hom1/sara/ && curl --max-time 180 --proxy aaaa:xxxx@$http_proxy ftp://67.125.134.122/out_files/DATA.ZIP
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.