![wget 실패: 연결 시간이 초과되었습니다.](https://rvso.com/image/769294/wget%20%EC%8B%A4%ED%8C%A8%3A%20%EC%97%B0%EA%B2%B0%20%EC%8B%9C%EA%B0%84%EC%9D%B4%20%EC%B4%88%EA%B3%BC%EB%90%98%EC%97%88%EC%8A%B5%EB%8B%88%EB%8B%A4..png)
웹사이트를 복사하려면 다음 명령을 사용하세요.
sun.com에 접속하려고 할 때 연결 시간이 초과되었습니다.
wget이 다음 작업을 진행할 수 있도록 wget에서 sun.com을 제외하고 싶습니다.
기존 문제
$ wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows http://pt.jikos.cz/garfield/
.
.
2021-08-09 03:28:28 (19.1 MB/s) - ‘packages.debian.org/robots.txt’ saved [24/24]
2021-08-09 03:28:30 (19.1 MB/s) - ‘packages.debian.org/robots.txt’ saved [24/24]
.
Location: https : //packages. debian. org /robots.txt [following]
--2021-08-09 03:28:33-- https : //packages. debian. org /robots.txt
Connecting to packages.debian.org (packages.debian.org)|128.0.10.50|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 24 [text/plain]
Saving to: ‘packages.debian.org/robots.txt’
packages.debian.org 100%[===================>] 24 --.-KB/s in 0s
2021-08-09 03:28:34 (19.1 MB/s) - ‘packages.debian.org/robots.txt’ saved [24/24]
Loading robots.txt; please ignore errors.
--2021-08-09 03:28:34-- http ://wwws. sun. com/ robots.txt
Resolving wwws.sun.com (wwws.sun.com)... 137.254.16.75
Connecting to wwws.sun.com (wwws.sun.com)|137.254.16.75|:80... failed: Connection timed out.
Retrying.
--2021-08-09 03:28:56-- (try: 2) http ://wwws. sun. com/ robots.txt
Connecting to wwws.sun.com (wwws.sun.com)|137.254.16.75|:80... failed: Connection timed out.
Retrying.
--2021-08-09 03:29:19-- (try: 3) http ://wwws. sun. com/ robots.txt
Connecting to wwws.sun.com (wwws.sun.com)|137.254.16.75|:80... failed: Connection timed out.
Retrying.
--2021-08-09 03:29:43-- (try: 4) http ://wwws. sun. com/ robots.txt
Connecting to wwws.sun.com (wwws.sun.com)|137.254.16.75|:80... failed: Connection timed out.
Retrying.
--2021-08-09 03:30:08-- (try: 5) http ://wwws. sun. com/ robots.txt
Connecting to wwws.sun.com (wwws.sun.com)|137.254.16.75|:80... failed: Connection timed out.
Retrying.
--2021-08-09 03:30:34-- (try: 6) http ://wwws. sun. com/ robots.txt
Connecting to wwws.sun.com (wwws.sun.com)|137.254.16.75|:80... failed: Connection timed out.
Retrying.
--2021-08-09 03:31:01-- (try: 7) http ://wwws. sun. com/ robots.txt
Connecting to wwws.sun.com (wwws.sun.com)|137.254.16.75|:80... failed: Connection timed out.
Retrying.
$wget이 시간 초과 없이 전체 웹사이트를 저장할 것으로 예상됩니다. 시간 초과가 있는 경우 wget은 시간 초과 연결을 건너뜁니다.
답변1
--span-hosts
( ) 옵션 사용의 "위험" -H
과 제한 사항을 추가하여 위험을 제한하는 방법에 대한 자세한 설명서를 읽어보십시오.
https://www.gnu.org/software/wget/manual/wget.html#Spanning-Hosts
--span-hosts
or 옵션-H
은 호스트 스패닝을 활성화하여 Wget의 재귀 실행이 링크에서 참조하는 모든 호스트를 방문할 수 있도록 합니다.충분한 재귀 제한 기준이 적용되지 않는 한 이러한 외부 호스트는 일반적으로 더 많은 호스트에 연결됩니다.Wget이 의도한 것보다 훨씬 더 많은 데이터를 흡수하게 될 때까지 말이죠.
...
특정 도메인으로 확장 제한
-D
이-D
옵션을 사용하면 따라갈 도메인을 지정할 수 있으므로 해당 도메인에 속한 호스트로만 재귀를 제한할 수 있습니다.
...
특정 도메인에서 다운로드 유지
--exclude-domains
구체적으로 제외하려는 도메인이 있는 경우--exclude-domains
와 동일한 유형의 인수를 허용-D
하지만 나열된 모든 도메인을 제외하는 를 사용하여 이를 수행할 수 있습니다.