http - Download only new/modified files with perl (or wget) -
I have a Perl script that downloads a large number of files from remote servers, I would like to avoid teasing the server, so Would I like to avoid downloading a file if it has not been modified since my last check? Is there a good way to do this, either in Perl or with a shell script?
Do I want to send the server HTTP for uncompressed files instead of HTTP?
Yes, use and pay special attention to the mirror
method. It is also available as a procedure in the form of the mirror
function.
Will go If the file already exists, then the request will be "if-modified-from" header that matches the modification time of the file. If the document on the server has not changed since then, then nothing happens. If the document has been updated, it will be downloaded again. The amendment of the file will be compelled to match the time server.
Return value is a response object.
The HTTP 304 response code is if you pass the -modified-test and your copy is refreshed then the server will return LWP internally with mirror
- You do not have to worry about it.
Comments
Post a Comment