Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Instruct WGET to only download the same file if the existing one is older [closed]

Tags:

command

wget

As the question states how to instruct WGET to only download the same file if the existing one is older

e.g. fileA has a date / file stamp of 9.00AM 10/10/2011

e.g. fileA on the remote server has a date / file stamp of 11AM 10/10/2011

so wget will download FileA on the server as its newer (and overwrite the local file)

Any help would be greatly appreciated, I have heard this is possible, but after looking around for a while I havn't come up with anything

like image 653
James Avatar asked May 09 '11 21:05

James


People also ask

Does Wget overwrite file?

You can run the command above as many times as you like and Wget will download the file and overwrite the existing one. If you run the command above without the -O option, Wget will create a new file each time you run it.

What does Wget flag do?

The [option] flag lets you specify the action to perform with the wget command. The [URL] flag points to the address of the directory, file, or webpage that you wish to download.

Which option for Wget turns on recursive downloads?

The ' -r ' option is to retrieve recursively, and ' -nd ' to not create directories. Note that ' --delete-after ' deletes files on the local machine.

What is Wget spider?

The wget tool is essentially a spider that scrapes / leeches web pages but some web hosts may block these spiders with the robots. txt files. Also, wget will not follow links on web pages that use the rel=nofollow attribute. You can however force wget to ignore the robots.


1 Answers

wget -N http://server/path/to/file.txt

like image 169
Timofey Stolbov Avatar answered Sep 18 '22 12:09

Timofey Stolbov