?
Solved

How to download files automatically from https website?

Posted on 2009-05-12
8
Medium Priority
?
438 Views
Last Modified: 2013-11-14
I get Zip file (containing 4 to 5 txt files) daily from a https secure website. I need to double click that zip file and save in my local disk and unzip to get the files. I want to make it automate as this is a daily process. How can I achieve this?
0
Comment
Question by:GouthamAnand
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 57

Expert Comment

by:giltjr
ID: 24370974
under Unix you should be able to schedule a task using cron to execute the command wget https://hostname/location-of-file/file.name
0
 
LVL 48

Expert Comment

by:Tintin
ID: 24371085
Assuming your version of wget or curl has SSL support, you can do something like
#!/bin/sh
cd /download/dir
wget https://example.com/file.zip
unzip file.zip

Open in new window

0
 

Author Comment

by:GouthamAnand
ID: 24371308
The website has username and password. I need to pass those. How can I do that?  Do I need to do anything to execute the command wget  or will it be executed(in korn shell). Once the shell script is ready successfull in downloading then I make it to run daily by scheduling.
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 
LVL 48

Expert Comment

by:Tintin
ID: 24371348
I've updated the script to specify username/password and added some error checking.


#!/bin/sh
cd /download/dir
wget --user=username --password=yourpassword https://example.com/file.zip
 
if [ $? -eq 0 ]
then
   unzip file.zip
else
   echo "wget failed"
fi

Open in new window

0
 

Author Comment

by:GouthamAnand
ID: 24371468
But it is giving error "wget: not found. wget failed"
0
 
LVL 48

Expert Comment

by:Tintin
ID: 24371538
What Unix/Linux flavour are you on?  

Can you install additional software if needed?

What is the result of:

which curl


0
 

Author Comment

by:GouthamAnand
ID: 24371619
I am using HP-UX

I can install additional software if needed.

result fo which curl is
no curl in /u1010/...(some long path is here)


.
0
 
LVL 48

Accepted Solution

by:
Tintin earned 2000 total points
ID: 24371846
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Many people tend to confuse the function of a virus with the one of adware, this misunderstanding of the basic of what each software is and how it operates causes users and organizations to take the wrong security measures that would protect them ag…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question