Go to the first, previous, next, last section, table of contents.


Time-Stamping Usage

The usage of time-stamping is simple. Say you would like to download a file so that it keeps its date of modification.

wget -S http://www.gnu.ai.mit.edu/

A simple ls -l shows that the time stamp on the local file equals the state of the Last-Modified header, as returned by the server. As you can see, the time-stamping info is preserved locally, even without `-N'.

Several days later, you would like Wget to check if the remote file has changed, and download it if it has.

wget -N http://www.gnu.ai.mit.edu/

Wget will ask the server for the last-modified date. If the local file is newer, the remote file will not be re-fetched. However, if the remote file is more recent, Wget will proceed fetching it normally.

The same goes for FTP. For example:

wget ftp://ftp.ifi.uio.no/pub/emacs/gnus/*

ls will show that the timestamps are set according to the state on the remote server. Reissuing the command with `-N' will make Wget re-fetch only the files that have been modified.

In both HTTP and FTP retrieval Wget will time-stamp the local file correctly (with or without `-N') if it gets the stamps, i.e. gets the directory listing for FTP or the Last-Modified header for HTTP.

If you wished to mirror the GNU archive every week, you would use the following command every week:

wget --timestamping -r ftp://prep.ai.mit.edu/pub/gnu/


Go to the first, previous, next, last section, table of contents.