Download the newest file
Hello! As I wrote in the topic; how to download (by wget or something) the newest package from given HTTP directory? Package looks like "package_v14.14.0.tar.gz".
|
Code:
wget http;//url.of.site/path/to/package_123.tar.gz |
Quote:
|
you need to find a way to know the newest, http is not the right way (you may or may not read directory content and you cannot modify it from the client side)
|
Solution is like this:
Quote:
|
wget -O - http://... | grep -o ... | sed ... | tail
but I'm not really sure about the result. Does it always return the latest? |
this web directory is sorted by modified date:
http://schneidz.noip.me/temp/?C=M;O=A perhaps you can scrape the html to wget the last entry ? |
As you can see from the above, there is no universal way to do it. You need to tailor your solution to the particular server you're pulling data off of. How do you know one file is newer than another? Are there version numbers? Modification dates? How are things named?
First determine how YOU would identify the newest file, and then write a set of instructions that will allow a script to do the same. |
All times are GMT -5. The time now is 09:16 PM. |