command - 如果现有文件较旧,则指示 WGET 仅下载相同的文件

标签 command wget

关闭。这个问题是off-topic .它目前不接受答案。












想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。

9年前关闭。




Improve this question




正如问题所述,如果现有文件较旧,如何指示 WGET 仅下载相同的文件

例如fileA 的日期/文件戳为 2011 年 10 月 10 日上午 9 点

例如远程服务器上的 fileA 的日期/文件戳为 11AM 10/10/2011

所以 wget 将在服务器上下载 FileA 作为它的更新(并覆盖本地文件)

任何帮助将不胜感激,我听说这是可能的,但环顾四周后,我没有想出任何东西

最佳答案

看看timestamping wget手册中的部分:

Time-Stamping

One of the most important aspects of mirroring information from the Internet is updating your archives.

Downloading the whole archive again and again, just to replace a few changed files is expensive, both in terms of wasted bandwidth and money, and the time to do the update. This is why all the mirroring tools offer the option of incremental updating.

Such an updating mechanism means that the remote server is scanned in search of new files. Only those new files will be downloaded in the place of the old ones.

A file is considered new if one of these two conditions are met:

  1. A file of that name does not already exist locally.

  2. A file of that name does exist, but the remote file was modified more recently than the local file.

To implement this, the program needs to be aware of the time of last modification of both local and remote files. We call this information the time-stamp of a file.

The time-stamping in GNU Wget is turned on using ‘--timestamping’ (‘-N’) option, or through timestamping = on directive in .wgetrc. With this option, for each file it intends to download, Wget will check whether a local file of the same name exists. If it does, and the remote file is not newer, Wget will not download it.

If the local file does not exist, or the sizes of the files do not match, Wget will download the remote file no matter what the time-stamps say.

关于command - 如果现有文件较旧,则指示 WGET 仅下载相同的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5942453/

相关文章:

php - 如何在 Windows 中运行 "brew"命令?

windows - 如何通过特殊的 :export using curl/wget on Windows 导出名称中带有斜线的维基百科文章

unix - Solr DataImportHandler 清算索引

bash - 转义 "#"标志

wget - 如何用wget重命名下载的文件?

video - 如何避免 ffmpeg filter_complex 覆盖文件的 fps?

java - 如何使用 Java 打开命令提示符并插入命令?

linux - 使用 wget 下载 shell 文件

batch-file - 如何将命令发送到通过批处理命令行运行的 EXE?

用于内联命令的 bash