LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Use wget to download newest version of file (https://www.linuxquestions.org/questions/linux-newbie-8/use-wget-to-download-newest-version-of-file-4175578147/)

Adol 04-23-2016 12:45 AM

Use wget to download newest version of file
 
Hello,

I made a script to automate a linux install with all packages and configurations for a security server at work.

Everything works well, but I would like to tweak it to download the newest version of a proprietary package.

The problem I'm having is that the package provider makes minor updates frequently, and the revision number of the package changes. The way I am currently using "wget" is very simple, and it doesn't download unless I provide the complete name of the package:

Code:

wget http://username:password@exacq.com/reseller/7.6/exacqVisionServer-7.6.2.94278.deb
What would you recommend to download the newest revision when the script runs? Can you somehow use a wildcard in wget, then run a find on everything that was downloaded?(wildcard didn't work when I tried it)

HT-Borås 04-23-2016 01:37 AM

If you can get this via FTP, wget supports wildcards. Not via http, however.

ondoho 04-23-2016 12:38 PM

  • look at wget documentation. maybe it's possible to just go for the newest file?
  • consider using other download tool like curl?
  • get the name of the newest version by parsing some web content, then tell wget to download that. can be automated in a script.
i think i like the last option best :D

Adol 09-04-2016 01:29 PM

a little late for thanks, but thank you!

Curl does pretty much what I want, and it can follow re-directs.


All times are GMT -5. The time now is 10:52 AM.