What is the Wget Timestamping Feature?

The wget timestamping feature allows the command-line utility to automatically check the modification date of a remote file before downloading it. By comparing the remote file’s timestamp with the local file’s timestamp, wget ensures that it only downloads the file if the remote version is newer. This prevents redundant downloads, saving both network bandwidth and time when mirroring websites or maintaining backups.

How Wget Timestamping Works

When you use the timestamping feature, wget sends a specific HTTP or FTP request to the server to check the file’s properties without downloading the entire payload.

Key Benefits of Using Timestamping

Implementing timestamping is highly efficient for automated scripts, cron jobs, and large-scale data synchronization.

How to Trigger Timestamping in the Command Line

To enable this feature, you use the -N (or --timestamping) option in your command.

wget -N https://example.com/data-file.csv

If you run this command a second time, and the data-file.csv on the server has not changed, wget will acknowledge the local file is current and exit without downloading it again.