Ubuntu: Command line to check version of a file with wget?



Question:

http://paste.ubuntu.com/7159470/

Is there a way to check the version of a file using wget, and then download it if it's newer? Trying to make an update script/launcher for a game.

wget http://testing.albiononline.com/clients/Albion-Online-Client-Linux.zip  


Solution:1

wget --content-disposition URL

Update: This is supposed to be the command but according to the man page it is experimental. It may not work.

You can use wget --no-clobber "URL". What this does is skips any files that you already have. Though I am bit confused. If you already have the URL to the exact filename, how could the version be different? I would make it version controlled/archived.

wget --spider "URL" may also be useful for you.

The man wget description

‘--spider’ When invoked with this option, Wget will behave as a Web spider, which means that it will not download the pages, just check that they are there. For example, you can use Wget to check your bookmarks:

      `wget --spider --force-html -i bookmarks.html`   

This feature needs much more work for Wget to get close to the functionality of real web spiders.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »