파일을 중복 다운로드하지 않고 wget이 로컬 복사본을 참조하도록 합니다.

파일을 중복 다운로드하지 않고 wget이 로컬 복사본을 참조하도록 합니다.

메시지 보드를 보관하고 싶습니다. wget을 매개변수 ( --page-requisites, 및 ) 와 함께 사용하면 됩니다 .--span-hosts--convert-links--no-clobber

문제는 사용이 --convert-links비활성화 된다는 것입니다 --no-clobber. 모든 스레드 페이지에 대해 wget은 사이트 스킨, 스크립트 및 아이콘을 다시 다운로드합니다(업데이트 상태를 유지하기 위해).

wget이 이미 로컬에 존재하는 파일을 다운로드하지 못하게 하고, 파일에 대한 링크를 로컬 복사본에 참조하고, 아직 파일 시스템에 없는 파일만 다운로드하는 것을 방지할 수 있는 방법이 있습니까?

답변1

스위치를 포함하면 타임스탬프를 강제로 사용해야 -N한다고 생각합니다.wget

   -N
   --timestamping
       Turn on time-stamping.

이 스위치를 사용하면 wget로컬에 아직 없는 파일만 다운로드됩니다.

파일이 robots.txt로컬에 아직 존재하지 않는 경우 다운로드하세요.

$ wget -N http://google.com/robots.txt
--2014-06-15 21:18:16--  http://google.com/robots.txt
Resolving google.com (google.com)... 173.194.41.9, 173.194.41.14, 173.194.41.0, ...
Connecting to google.com (google.com)|173.194.41.9|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/robots.txt [following]
--2014-06-15 21:18:17--  http://www.google.com/robots.txt
Resolving www.google.com (www.google.com)... 173.194.46.83, 173.194.46.84, 173.194.46.80, ...
Connecting to www.google.com (www.google.com)|173.194.46.83|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Saving to: ‘robots.txt’

    [ <=>                                                                                                                                 ] 7,608       --.-K/s   in 0s      

2014-06-15 21:18:17 (359 MB/s) - ‘robots.txt’ saved [7608]

로컬에서 파일을 사용하여 두 번째 시도 robots.txt:

$ wget -N http://google.com/robots.txt
--2014-06-15 21:18:19--  http://google.com/robots.txt
Resolving google.com (google.com)... 173.194.41.8, 173.194.41.9, 173.194.41.14, ...
Connecting to google.com (google.com)|173.194.41.8|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://www.google.com/robots.txt [following]
--2014-06-15 21:18:19--  http://www.google.com/robots.txt
Resolving www.google.com (www.google.com)... 173.194.46.82, 173.194.46.83, 173.194.46.84, ...
Connecting to www.google.com (www.google.com)|173.194.46.82|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/plain]
Server file no newer than local file ‘robots.txt’ -- not retrieving.

두 번째로 wget파일을 다시 검색하지 않았습니다.

관련 정보