Quyền được cấp để sao chép, phân phối và/hoặc sửa đổi tài liệu này theo các điều khoản của Giấy phép Tài liệu Tự do GNU, Phiên bản 1. 3 hoặc bất kỳ phiên bản nào mới hơn do Tổ chức Phần mềm Tự do xuất bản; . Một bản sao của giấy phép được bao gồm trong phần có tiêu đề “Giấy phép Tài liệu Miễn phí GNU” Show
1. Tổng quanGNU Wget là một tiện ích miễn phí để tải xuống các tệp không tương tác từ Web. Nó hỗ trợ các giao thức HTTP, HTTPS và FTP, cũng như truy xuất thông qua proxy HTTP Chương này là tổng quan một phần về các tính năng của Wget
2 InvokingBy default, Wget is very simple to invoke. The basic syntax is Wget will simply download all the URLs specified on the command line. URL is a Uniform Resource Locator, as defined below However, you may wish to change some of the default parameters of Wget. You can do it two ways. permanently, adding the appropriate command to . wgetrc (see ), or specifying it on the command line 2. 1 URL FormatURL is an acronym for Uniform Resource Locator. A uniform resource locator is a compact string representation for a resource available via the Internet. Wget nhận ra cú pháp URL theo RFC1738. Đây là hình thức được sử dụng rộng rãi nhất (dấu ngoặc vuông biểu thị các phần tùy chọn) http://host[:port]/directory/file ftp://host[:port]/directory/file Bạn cũng có thể mã hóa tên người dùng và mật khẩu của mình trong một URL ftp://user:password@host/path http://user:password@host/path Có thể bỏ qua người dùng hoặc mật khẩu hoặc cả hai. Nếu bạn bỏ qua tên người dùng hoặc mật khẩu HTTP, sẽ không có xác thực nào được gửi. Nếu bạn bỏ qua tên người dùng FTP, 'ẩn danh' sẽ được sử dụng. Nếu bạn bỏ qua mật khẩu FTP, địa chỉ email của bạn sẽ được cung cấp làm mật khẩu mặc định Lưu ý quan trọng. nếu bạn chỉ định một URL chứa mật khẩu trên dòng lệnh, tên người dùng và mật khẩu sẽ hiển thị rõ ràng đối với tất cả người dùng trên hệ thống, bằng cách wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z2. Trên các hệ thống nhiều người dùng, đây là một rủi ro bảo mật lớn. Để giải quyết vấn đề này, hãy sử dụng wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z3 và cung cấp URL cho đầu vào tiêu chuẩn của Wget, mỗi URL nằm trên một dòng riêng biệt, được kết thúc bởi C-d Bạn có thể mã hóa các ký tự không an toàn trong URL dưới dạng '%xy', wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z4 là biểu diễn thập lục phân của giá trị ASCII của ký tự. Một số ký tự không an toàn phổ biến bao gồm '%' (được trích dẫn là '%25'), '. ’ (được trích dẫn là ‘%3A’) và ‘@’ (được trích dẫn là ‘%40’). Tham khảo RFC1738 để biết danh sách đầy đủ các ký tự không an toàn Wget cũng hỗ trợ tính năng wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z5 cho URL FTP. Theo mặc định, các tài liệu FTP được truy xuất ở chế độ nhị phân (nhập 'i'), có nghĩa là chúng được tải xuống không thay đổi. Một chế độ hữu ích khác là chế độ 'a' (ASCII), chuyển đổi các dấu phân cách dòng giữa các hệ điều hành khác nhau và do đó rất hữu ích cho các tệp văn bản. Đây là một ví dụ ftp://host/directory/file;type=a Hai biến thể thay thế của đặc tả URL cũng được hỗ trợ, vì lý do lịch sử (cuồng loạn?) và việc sử dụng rộng rãi của chúng Cú pháp chỉ dành cho FTP (được hỗ trợ bởi wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z6) Cú pháp chỉ dành cho HTTP (được giới thiệu bởi wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z7) These two alternative forms are deprecated, and may cease being supported in the future If you do not understand the difference between these notations, or do not know which one to use, just use the plain ordinary format you use with your favorite browser, like wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z8 or wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z7 2. 2 Tùy chọn Cú phápVì Wget sử dụng GNU getopt để xử lý các đối số dòng lệnh, mọi tùy chọn đều có dạng dài cùng với dạng ngắn. Các tùy chọn dài sẽ thuận tiện hơn để nhớ, nhưng mất thời gian để gõ. You may freely mix different option styles, or specify options after the command-line arguments. Vì vậy bạn có thể viết wget -r --tries=10 http://fly.srk.fer.hr/ -o log Khoảng cách giữa tùy chọn chấp nhận một đối số và đối số có thể được bỏ qua. Instead of ‘-o log’ you can write ‘-olog’ Bạn có thể đặt một số tùy chọn không yêu cầu đối số cùng nhau, chẳng hạn như Điều này hoàn toàn tương đương với Vì các tùy chọn có thể được chỉ định sau các đối số, bạn có thể chấm dứt chúng bằng '--'. Vì vậy, phần sau sẽ cố tải xuống URL '-x', báo cáo không đăng nhập được Tất cả các tùy chọn chấp nhận danh sách được phân tách bằng dấu phẩy đều tôn trọng quy ước chỉ định danh sách trống sẽ xóa giá trị của nó. Điều này có thể hữu ích để xóa. cài đặt wgetrc. Ví dụ, nếu bạn. wgetrc đặt No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...0 thành /cgi-bin, ví dụ sau trước tiên sẽ đặt lại nó, sau đó đặt thành loại trừ /~nobody và /~somebody. Bạn cũng có thể xóa danh sách trong. wgetrc (see ) wget -X '' -X /~nobody,/~somebody Hầu hết các tùy chọn không chấp nhận đối số là các tùy chọn boolean, được đặt tên như vậy vì trạng thái của chúng có thể được nắm bắt bằng biến có-hoặc-không (“boolean”). Ví dụ: ‘--follow-ftp’ yêu cầu Wget theo dõi các liên kết FTP từ các tệp HTML và mặt khác, ‘--no-glob’ yêu cầu Wget không thực hiện toàn cầu hóa tệp trên các URL FTP. Một tùy chọn boolean là khẳng định hoặc phủ định (bắt đầu bằng '--no'). Tất cả các tùy chọn như vậy chia sẻ một số thuộc tính Trừ khi có quy định khác, người ta cho rằng hành vi mặc định ngược lại với những gì tùy chọn thực hiện. For example, the documented existence of ‘--follow-ftp’ assumes that the default is to not follow FTP links from HTML pages Các tùy chọn khẳng định có thể bị phủ nhận bằng cách thêm '--no-' vào tên tùy chọn; . Điều này có vẻ thừa—nếu mặc định cho một tùy chọn khẳng định là không làm điều gì đó, thì tại sao lại cung cấp một cách để tắt nó đi một cách rõ ràng? . Chẳng hạn, sử dụng No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...1 trong. wgetrc makes Wget follow FTP links by default, and using ‘--no-follow-ftp’ is the only way to restore the factory default from the command line 2. 3 tùy chọn khởi động cơ bản'-V''--phiên bản'Display the version of Wget ‘-h’‘--giúp đỡ’In thông báo trợ giúp mô tả tất cả các tùy chọn dòng lệnh của Wget '-b''--nền'Chuyển đến nền ngay sau khi khởi động. If no output file is specified via the ‘-o’, output is redirected to wget-log ‘-e command’‘--execute command’Thực hiện lệnh như thể nó là một phần của. wgetrc (xem ). Một lệnh được gọi như vậy sẽ được thực thi sau các lệnh trong. wgetrc, do đó được ưu tiên hơn chúng. Nếu bạn cần chỉ định nhiều hơn một lệnh wgetrc, hãy sử dụng nhiều phiên bản của '-e' 2. 4 Tùy chọn tệp ghi nhật ký và đầu vào‘-o logfile’‘--output-file=logfile’Ghi tất cả các tin nhắn vào logfile. Các thông báo thường được báo cáo là lỗi tiêu chuẩn ‘-a logfile’‘--append-output=logfile’Nối vào logfile. Điều này giống như '-o', chỉ có điều nó nối thêm vào tệp nhật ký thay vì ghi đè lên tệp nhật ký cũ. Nếu tệp nhật ký không tồn tại, một tệp mới sẽ được tạo '-d''--gỡ lỗi'Bật đầu ra gỡ lỗi, nghĩa là nhiều thông tin quan trọng đối với các nhà phát triển của Wget nếu nó không hoạt động bình thường. Quản trị viên hệ thống của bạn có thể đã chọn biên dịch Wget mà không hỗ trợ gỡ lỗi, trong trường hợp đó, '-d' sẽ không hoạt động. Xin lưu ý rằng việc biên dịch với hỗ trợ gỡ lỗi luôn an toàn—Wget được biên dịch với hỗ trợ gỡ lỗi sẽ không in bất kỳ thông tin gỡ lỗi nào trừ khi được yêu cầu với '-d'. See , for more information on how to use ‘-d’ for sending bug reports '-q''--im lặng'Tắt đầu ra của Wget ‘-v’‘--verbose’Bật đầu ra dài dòng, với tất cả dữ liệu có sẵn. Đầu ra mặc định là dài dòng ‘-nv’‘--no-dài dòng’Tắt dài dòng mà không hoàn toàn im lặng (sử dụng '-q' cho điều đó), có nghĩa là các thông báo lỗi và thông tin cơ bản vẫn được in '--report-speed=type'Băng thông đầu ra dưới dạng loại. Giá trị duy nhất được chấp nhận là 'bit' '-i tệp''--input-file=file'Đọc URL từ tệp cục bộ hoặc tệp bên ngoài. Nếu '-' được chỉ định dưới dạng tệp, các URL được đọc từ đầu vào tiêu chuẩn. (Sử dụng '. /-' để đọc từ một tệp có tên theo nghĩa đen là '-'. ) Nếu chức năng này được sử dụng, không cần có URL trên dòng lệnh. Nếu có cả URL trên dòng lệnh và trong tệp đầu vào, những URL trên dòng lệnh sẽ là những cái đầu tiên được truy xuất. Nếu '--force-html' không được chỉ định, thì tệp phải bao gồm một loạt các URL, mỗi URL một dòng Tuy nhiên, nếu bạn chỉ định '--force-html', tài liệu sẽ được coi là 'html'. Trong trường hợp đó, bạn có thể gặp sự cố với các liên kết tương đối, bạn có thể giải quyết vấn đề này bằng cách thêm No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...2 vào tài liệu hoặc bằng cách chỉ định '--base=url' trên dòng lệnh Nếu tệp là tệp bên ngoài, tài liệu sẽ tự động được coi là 'html' nếu Loại nội dung khớp với 'text/html'. Furthermore, the file’s location will be implicitly used as base href if none was specified '--input-metalink=tệp'Tải xuống các tệp có trong tệp Metalink cục bộ. Metalink version 3 and 4 are supported '--keep-badhash'Giữ các tệp của Metalink đã tải xuống với hàm băm xấu. Nó nối thêm. badhash vào tên các tệp của Metalink có tổng kiểm tra không khớp, ngoại trừ việc không ghi đè lên các tệp hiện có ‘--metalink-over-http’Đưa ra yêu cầu HTTP HEAD thay vì GET và trích xuất siêu dữ liệu Metalink từ các tiêu đề phản hồi. Sau đó, nó chuyển sang tải xuống Metalink. Nếu không tìm thấy siêu dữ liệu Metalink hợp lệ, nó sẽ quay lại tải xuống HTTP thông thường. Bật 'Loại nội dung. tải xuống/xử lý tệp application/metalink4+xml’ '--metalink-index=number''--preferred-location'Đặt vị trí ưa thích cho tài nguyên Metalink. Điều này có hiệu lực nếu có nhiều tài nguyên có cùng mức độ ưu tiên ‘--xattr’Cho phép sử dụng các thuộc tính mở rộng của hệ thống tệp để lưu URL gốc và giá trị tiêu đề HTTP của Người giới thiệu nếu được sử dụng Xin lưu ý rằng URL có thể chứa thông tin cá nhân như mã thông báo truy cập hoặc thông tin đăng nhập ‘-F’‘--force-html’‘-B URL’‘--base=URL’Giải quyết các liên kết tương đối bằng cách sử dụng URL làm điểm tham chiếu, khi đọc các liên kết từ tệp HTML được chỉ định qua tùy chọn '-i'/'--input-file' (cùng với '--force-html' hoặc khi tệp đầu vào . Điều này tương đương với sự hiện diện của thẻ No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...3 trong tệp đầu vào HTML, với URL là giá trị cho thuộc tính No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...4 Chẳng hạn, nếu bạn chỉ định 'http. // foo/bar/a. html' cho URL và Wget đọc '. /baz/b. html' từ tệp đầu vào, nó sẽ được phân giải thành 'http. //foo/baz/b. html' ‘--config=TỆP’Chỉ định vị trí của tệp khởi động mà bạn muốn sử dụng thay vì (các) tệp mặc định. Use –no-config to disable reading of config files. Nếu cả hai –config và –no-config đều được cung cấp, thì –no-config sẽ bị bỏ qua ‘--rejected-log=logfile’Ghi nhật ký tất cả các lần từ chối URL vào tệp nhật ký dưới dạng các giá trị được phân tách bằng dấu phẩy. Các giá trị bao gồm lý do từ chối, URL và URL gốc mà nó được tìm thấy trong 2. 5 Tùy chọn tải xuống'--bind-address=ADDRESS'Khi tạo kết nối TCP/IP của máy khách, hãy liên kết với ADDRESS trên máy cục bộ. ADDRESS có thể được chỉ định làm tên máy chủ hoặc địa chỉ IP. Tùy chọn này có thể hữu ích nếu máy của bạn bị ràng buộc với nhiều IP '--bind-dns-address=ĐỊA CHỈ'[libcares only] Địa chỉ này ghi đè tuyến đường cho các yêu cầu DNS. Nếu bạn cần phá vỡ các cài đặt tiêu chuẩn từ /etc/resolv. conf, tùy chọn này cùng với ‘--dns-servers’ là bạn của bạn. ADDRESS phải được chỉ định là địa chỉ IPv4 hoặc IPv6. Wget cần được xây dựng với libcares để có tùy chọn này ‘--dns-servers=ADDRESSES’[chỉ libcares] (Các) địa chỉ đã cho sẽ ghi đè địa chỉ máy chủ định danh tiêu chuẩn, e. g. as configured in /etc/resolv. conf. ĐỊA CHỈ có thể được chỉ định là địa chỉ IPv4 hoặc IPv6, được phân tách bằng dấu phẩy. Wget needs to be built with libcares for this option to be available '-t số''--tries=số'Set number of tries to number. Chỉ định 0 hoặc 'inf' để thử lại vô hạn. Mặc định là thử lại 20 lần, ngoại trừ các lỗi nghiêm trọng như “kết nối bị từ chối” hoặc “không tìm thấy” (404), không được thử lại ‘-O file’‘--output-document=file’‘-nc’‘--no-clobber’Nếu một tệp được tải xuống nhiều lần trong cùng một thư mục, hành vi của Wget sẽ phụ thuộc vào một số tùy chọn, bao gồm '-nc'. Trong một số trường hợp nhất định, tệp cục bộ sẽ bị ghi đè hoặc ghi đè khi tải xuống nhiều lần. Các trường hợp khác sẽ được giữ nguyên Khi chạy Wget mà không có '-N', '-nc', '-r' hoặc '-p', việc tải xuống cùng một tệp trong cùng một thư mục sẽ dẫn đến bản sao gốc của tệp được giữ nguyên và bản sao thứ hai được đặt tên là ' . 1’. Nếu tệp đó được tải xuống một lần nữa, bản sao thứ ba sẽ được đặt tên là 'tệp. 2', v.v. (Đây cũng là hành vi với '-nd', ngay cả khi '-r' hoặc '-p' có hiệu lực. ) Khi '-nc' được chỉ định, hành vi này bị chặn và Wget sẽ từ chối tải xuống các bản sao mới hơn của 'tệp'. Do đó, “ No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...5” thực sự là một cách gọi sai trong chế độ này—không phải việc ghi đè đã bị ngăn chặn (vì các hậu tố số đã ngăn cản việc ghi đè), mà là việc lưu nhiều phiên bản đã bị ngăn chặn Khi chạy Wget với '-r' hoặc '-p', nhưng không có '-N', '-nd' hoặc '-nc', việc tải xuống lại một tệp sẽ khiến bản sao mới ghi đè lên bản cũ. Việc thêm '-nc' sẽ ngăn hành vi này, thay vào đó khiến phiên bản gốc được giữ nguyên và mọi bản sao mới hơn trên máy chủ sẽ bị bỏ qua When running Wget with ‘-N’, with or without ‘-r’ or ‘-p’, the decision as to whether or not to download a newer copy of a file depends on the local and remote timestamp and size of the file (see ). '-nc' có thể không được chỉ định cùng lúc với '-N' Sự kết hợp với ‘-O’/‘--output-document’ chỉ được chấp nhận nếu tệp đầu ra đã cho không tồn tại Lưu ý rằng khi '-nc' được chỉ định, các tệp có hậu tố '. html' hoặc '. htm’ sẽ được tải từ đĩa cục bộ và được phân tích cú pháp như thể chúng được lấy từ Web ‘--backups=backups’‘--no-netrc’Đừng cố lấy thông tin xác thực từ. netrc file. theo mặc định. tệp netrc được tìm kiếm thông tin đăng nhập trong trường hợp không có thông tin nào được chuyển qua dòng lệnh và yêu cầu xác thực ‘-c’‘--tiếp tục’Tiếp tục nhận tệp đã tải xuống một phần. Điều này hữu ích khi bạn muốn kết thúc quá trình tải xuống được bắt đầu bởi phiên bản trước của Wget hoặc bởi một chương trình khác. Ví dụ wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z Nếu có một tệp có tên ls-lR. Z trong thư mục hiện tại, Wget sẽ cho rằng đó là phần đầu tiên của tệp từ xa và sẽ yêu cầu máy chủ tiếp tục truy xuất từ một phần bù bằng độ dài của tệp cục bộ Note that you don’t need to specify this option if you just want the current invocation of Wget to retry downloading a file should the connection be lost midway through. Đây là hành vi mặc định. '-c' chỉ ảnh hưởng đến việc tiếp tục tải xuống đã bắt đầu trước khi gọi Wget này và các tệp cục bộ của chúng vẫn đang nằm xung quanh Nếu không có '-c', ví dụ trước sẽ chỉ tải tệp từ xa xuống ls-lR. Z. 1, để lại ls-lR bị cắt ngắn. Tập tin Z một mình Nếu bạn sử dụng '-c' trên tệp không trống và máy chủ không hỗ trợ tiếp tục tải xuống, Wget sẽ khởi động lại quá trình tải xuống từ đầu và ghi đè hoàn toàn tệp hiện có Bắt đầu với Wget 1. 7, if you use ‘-c’ on a file which is of equal size as the one on the server, Wget will refuse to download the file and print an explanatory message. The same happens when the file is smaller on the server than locally (presumably because it was changed on the server since your last download attempt)—because “continuing” is not meaningful, no download occurs Mặt khác, trong khi sử dụng '-c', bất kỳ tệp nào trên máy chủ lớn hơn cục bộ sẽ được coi là tải xuống không đầy đủ và chỉ No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...6 byte sẽ được tải xuống và gắn vào cuối tệp cục bộ. Hành vi này có thể được mong muốn trong một số trường hợp nhất định—ví dụ: bạn có thể sử dụng 'wget -c' để chỉ tải xuống phần mới được thêm vào một tập hợp dữ liệu hoặc tệp nhật ký Tuy nhiên, nếu tệp lớn hơn trên máy chủ vì nó đã bị thay đổi, thay vì chỉ được thêm vào, bạn sẽ nhận được một tệp bị cắt xén. Wget không có cách nào xác minh rằng tệp cục bộ thực sự là tiền tố hợp lệ của tệp từ xa. Bạn cần đặc biệt cẩn thận với điều này khi sử dụng ‘-c’ kết hợp với ‘-r’, vì mọi tệp sẽ được coi là ứng cử viên "tải xuống chưa hoàn tất" Một trường hợp khác mà bạn sẽ nhận được một tệp bị cắt xén nếu bạn cố gắng sử dụng '-c' là nếu bạn có một proxy HTTP khập khiễng chèn chuỗi "chuyển bị gián đoạn" vào tệp cục bộ. Trong tương lai, tùy chọn “rollback” có thể được thêm vào để giải quyết trường hợp này Lưu ý rằng '-c' chỉ hoạt động với máy chủ FTP và máy chủ HTTP hỗ trợ tiêu đề No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...7‘--start-pos=OFFSET’‘--progress=type’ Chọn loại chỉ báo tiến độ bạn muốn sử dụng. Dấu hiệu pháp lý là “chấm” và “thanh” Chỉ báo “thanh” được sử dụng theo mặc định. Nó vẽ một đồ họa thanh tiến trình ASCII (a. k. màn hình “nhiệt kế”) cho biết trạng thái truy xuất. Nếu đầu ra không phải là TTY, thanh "chấm" sẽ được sử dụng theo mặc định Sử dụng '--progress=dot' để chuyển sang màn hình "chấm". Nó theo dõi quá trình truy xuất bằng cách in các dấu chấm trên màn hình, mỗi dấu chấm biểu thị một lượng dữ liệu đã tải xuống cố định Loại tiến trình cũng có thể nhận một hoặc nhiều tham số. Các tham số khác nhau tùy thuộc vào loại được chọn. Các tham số cho loại được truyền bằng cách thêm chúng vào loại được phân cách bằng dấu hai chấm (. ) như thế này. '--progress = loại. tham số1. tham số2' When using the dotted retrieval, you may set the style by specifying the type as ‘dot. Phong cách'. Các phong cách khác nhau gán ý nghĩa khác nhau cho một dấu chấm. Với kiểu No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...8, mỗi dấu chấm đại diện cho 1K, có 10 dấu chấm trong một cụm và 50 dấu chấm trong một dòng. Kiểu No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...9 có định hướng giống “máy tính” hơn—8 nghìn chấm, cụm 16 chấm và 48 chấm trên mỗi dòng (tạo nên 384 nghìn dòng). Kiểu wget --no-cookies --header "Cookie: name=value"0 phù hợp để tải xuống các tệp lớn—mỗi dấu chấm đại diện cho 64K được truy xuất, có 8 dấu chấm trong một cụm và 48 dấu chấm trên mỗi dòng (vì vậy mỗi dòng chứa 3M). Nếu wget --no-cookies --header "Cookie: name=value"0 không đủ thì bạn có thể sử dụng kiểu wget --no-cookies --header "Cookie: name=value"2—mỗi dấu chấm đại diện cho 1M được truy xuất, có tám dấu chấm trong một cụm và 32 dấu chấm trên mỗi dòng (vì vậy mỗi dòng chứa 32 triệu) Với ‘--progress=bar’, hiện tại có hai tham số khả thi là force và noscroll Khi đầu ra không phải là TTY, thanh tiến trình luôn quay trở lại "dấu chấm", ngay cả khi '--progress=bar' được chuyển đến Wget trong khi gọi. Hành vi này có thể bị ghi đè và đầu ra “bar” bị ép buộc bằng cách sử dụng tham số “force” là ‘--progress=bar. lực lượng' Theo mặc định, thanh tiến trình kiểu 'thanh' cuộn tên của tệp từ trái sang phải đối với tệp đang được tải xuống nếu tên tệp vượt quá độ dài tối đa được phân bổ cho màn hình của nó. Trong một số trường hợp nhất định, chẳng hạn như với ‘--progress=bar. force', người ta có thể không muốn tên tệp cuộn trong thanh tiến trình. Bằng cách chuyển tham số “noscroll”, Wget có thể buộc phải hiển thị càng nhiều tên tệp càng tốt mà không cần cuộn qua nó Lưu ý rằng bạn có thể đặt kiểu mặc định bằng cách sử dụng lệnh wget --no-cookies --header "Cookie: name=value"3 trong. wgetrc. Cài đặt đó có thể bị ghi đè từ dòng lệnh. Ví dụ: để buộc đầu ra của thanh mà không cần cuộn, hãy sử dụng ‘--progress=bar. lực lượng. không có cuộn giấy''--show-tiến độ' Buộc wget hiển thị thanh tiến trình ở bất kỳ mức độ chi tiết nào Theo mặc định, wget chỉ hiển thị thanh tiến trình ở chế độ dài dòng. Tuy nhiên, người ta có thể muốn quên hiển thị thanh tiến trình trên màn hình kết hợp với bất kỳ chế độ chi tiết nào khác như '--no-verbose' hoặc '--quiet'. Đây thường là một thuộc tính mong muốn khi gọi wget để tải xuống một số tệp nhỏ/lớn. Trong trường hợp như vậy, wget có thể được gọi đơn giản với tham số này để có được đầu ra sạch hơn nhiều trên màn hình Tùy chọn này cũng sẽ buộc thanh tiến trình được in thành thiết bị lỗi chuẩn khi được sử dụng cùng với tùy chọn '--output-file' '-N''--dấu thời gian'Bật đánh dấu thời gian. Xem, để biết chi tiết '--no-if-modified-kể từ'Không gửi tiêu đề If-Modified-Since ở chế độ '-N'. Gửi yêu cầu HEAD sơ bộ thay thế. Điều này chỉ có tác dụng trong chế độ '-N' '--no-use-server-timestamps'Không đặt dấu thời gian của tệp cục bộ bằng dấu thời gian trên máy chủ Theo mặc định, khi một tệp được tải xuống, dấu thời gian của nó được đặt để khớp với dấu thời gian từ tệp từ xa. Điều này cho phép sử dụng '--timestamping' trong các lần gọi wget tiếp theo. Tuy nhiên, đôi khi sẽ hữu ích khi căn cứ vào dấu thời gian của tệp cục bộ khi nó thực sự được tải xuống; '-S''--phản hồi máy chủ'In các tiêu đề được gửi bởi máy chủ HTTP và phản hồi được gửi bởi máy chủ FTP ‘--spider’‘-T seconds’‘--timeout=seconds’‘--dns-timeout=seconds’‘--connect-timeout=seconds’‘--read-timeout=seconds’Đặt thời gian chờ đọc (và ghi) thành giây giây. “Thời gian” của thời gian chờ này đề cập đến thời gian nhàn rỗi. nếu tại bất kỳ thời điểm nào trong quá trình tải xuống, không có dữ liệu nào được nhận trong hơn số giây đã chỉ định, thì quá trình đọc không thành công và quá trình tải xuống được bắt đầu lại. Tùy chọn này không ảnh hưởng trực tiếp đến thời lượng của toàn bộ quá trình tải xuống Tất nhiên, máy chủ từ xa có thể chọn ngắt kết nối sớm hơn tùy chọn này yêu cầu. Thời gian chờ đọc mặc định là 900 giây '--limit-rate=số tiền'Giới hạn tốc độ tải xuống theo số byte mỗi giây. Số tiền có thể được biểu thị bằng byte, kilobyte với hậu tố 'k' hoặc megabyte với hậu tố 'm'. Ví dụ: ‘--limit-rate=20k’ sẽ giới hạn tốc độ truy xuất ở mức 20KB/s. This is useful when, for whatever reason, you don’t want Wget to consume the entire available bandwidth Tùy chọn này cho phép sử dụng các số thập phân, thường kết hợp với các hậu tố lũy thừa; . 5k’ là giá trị hợp pháp Lưu ý rằng Wget thực hiện giới hạn bằng cách ngủ trong khoảng thời gian thích hợp sau khi đọc mạng mất ít thời gian hơn so với tốc độ được chỉ định. Cuối cùng, chiến lược này khiến quá trình truyền TCP chậm lại với tốc độ xấp xỉ đã chỉ định. Tuy nhiên, có thể mất một thời gian để đạt được sự cân bằng này, vì vậy đừng ngạc nhiên nếu việc giới hạn tốc độ không hoạt động tốt với các tệp rất nhỏ ‘-w giây’‘--wait=giây’Wait the specified number of seconds between the retrievals. Nên sử dụng tùy chọn này vì nó giảm tải cho máy chủ bằng cách làm cho các yêu cầu ít thường xuyên hơn. Thay vì tính bằng giây, thời gian có thể được chỉ định bằng phút bằng cách sử dụng hậu tố wget --no-cookies --header "Cookie: name=value"4, tính bằng giờ bằng hậu tố wget --no-cookies --header "Cookie: name=value"5 hoặc tính bằng ngày bằng hậu tố wget --no-cookies --header "Cookie: name=value"6 Việc chỉ định một giá trị lớn cho tùy chọn này sẽ hữu ích nếu mạng hoặc máy chủ đích không hoạt động, để Wget có thể đợi đủ lâu để mong đợi một cách hợp lý rằng lỗi mạng sẽ được khắc phục trước khi thử lại. Khoảng thời gian chờ được chỉ định bởi chức năng này bị ảnh hưởng bởi wget --no-cookies --header "Cookie: name=value"7, xem'--waitretry=giây' Nếu bạn không muốn Wget đợi giữa mỗi lần truy xuất mà chỉ giữa các lần tải xuống không thành công, bạn có thể sử dụng tùy chọn này. Wget sẽ sử dụng backoff tuyến tính, đợi 1 giây sau lỗi đầu tiên trên một tệp nhất định, sau đó đợi 2 giây sau lỗi thứ hai trên tệp đó, tối đa số giây bạn chỉ định Theo mặc định, Wget sẽ nhận giá trị là 10 giây '--chờ-ngẫu nhiên'Một số trang web có thể thực hiện phân tích nhật ký để xác định các chương trình truy xuất như Wget bằng cách tìm kiếm sự tương đồng có ý nghĩa thống kê về thời gian giữa các yêu cầu. Tùy chọn này làm cho thời gian giữa các yêu cầu khác nhau giữa 0. 5 và 1. 5 * wait seconds, where wait was specified using the ‘--wait’ option, in order to mask Wget’s presence from such analysis Một bài báo năm 2001 trong một ấn phẩm dành cho phát triển trên nền tảng tiêu dùng phổ biến đã cung cấp mã để thực hiện phân tích này một cách nhanh chóng. Tác giả của nó đã đề xuất chặn ở cấp địa chỉ lớp C để đảm bảo các chương trình truy xuất tự động bị chặn mặc dù đã thay đổi địa chỉ do DHCP cung cấp Tùy chọn '--random-wait' được lấy cảm hứng từ đề xuất không phù hợp này để chặn nhiều người dùng không liên quan khỏi một trang web do hành động của một '--không có proxy'Không sử dụng proxy, ngay cả khi biến môi trường wget --no-cookies --header "Cookie: name=value"8 thích hợp đã được xác định Xem , để biết thêm thông tin về việc sử dụng proxy với Wget ‘-Q hạn ngạch’‘--quota=hạn ngạch’Chỉ định hạn ngạch tải xuống để truy xuất tự động. Giá trị có thể được chỉ định bằng byte (mặc định), kilobyte (có hậu tố 'k') hoặc megabyte (có hậu tố 'm') Lưu ý rằng hạn ngạch sẽ không bao giờ ảnh hưởng đến việc tải xuống một tệp. Vì vậy, nếu bạn chỉ định 'wget -Q10k https. //thí dụ. com/ls-lR. gz’, tất cả ls-lR. gz sẽ được tải xuống. Điều tương tự cũng xảy ra ngay cả khi một số URL được chỉ định trên dòng lệnh. Hạn ngạch chỉ được kiểm tra ở cuối mỗi tệp đã tải xuống, vì vậy nó sẽ không bao giờ dẫn đến tệp được tải xuống một phần. Vì vậy, bạn có thể gõ ‘wget -Q2m -i pages’ một cách an toàn—việc tải xuống sẽ bị hủy bỏ sau khi tải xuống hoàn toàn tệp sử dụng hết hạn ngạch Đặt hạn ngạch thành 0 hoặc thành 'inf' không giới hạn hạn ngạch tải xuống ‘--no-dns-cache’Turn off caching of DNS lookups. Normally, Wget remembers the IP addresses it looked up from DNS so it doesn’t have to repeatedly contact the DNS server for the same (typically small) set of hosts it retrieves from. This cache exists in memory only; a new Wget run will contact DNS again However, it has been reported that in some situations it is not desirable to cache host names, even for the duration of a short-running application like Wget. With this option Wget issues a new DNS lookup (more precisely, a new call to wget --no-cookies --header "Cookie: name=value"9 or wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/0) each time it makes a new connection. Please note that this option will not affect caching that might be performed by the resolving library or by an external caching layer, such as NSCD If you don’t understand exactly what this option does, you probably won’t need it ‘--restrict-file-names=modes’Change which characters found in remote URLs must be escaped during generation of local filenames. Characters that are restricted by this option are escaped, i. e. replaced with ‘%HH’, where ‘HH’ is the hexadecimal number that corresponds to the restricted character. This option may also be used to force all alphabetical cases to be either lower- or uppercase By default, Wget escapes the characters that are not valid or safe as part of file names on your operating system, as well as control characters that are typically unprintable. This option is useful for changing these defaults, perhaps because you are downloading to a non-native partition, or because you want to disable escaping of the control characters, or you want to further restrict characters to only those in the ASCII range of values The modes are a comma-separated set of text values. The acceptable values are ‘unix’, ‘windows’, ‘nocontrol’, ‘ascii’, ‘lowercase’, and ‘uppercase’. The values ‘unix’ and ‘windows’ are mutually exclusive (one will override the other), as are ‘lowercase’ and ‘uppercase’. Those last are special cases, as they do not change the set of characters that would be escaped, but rather force local file paths to be converted either to lower- or uppercase When “unix” is specified, Wget escapes the character ‘/’ and the control characters in the ranges 0–31 and 128–159. This is the default on Unix-like operating systems When “windows” is given, Wget escapes the characters ‘\’, ‘|’, ‘/’, ‘:’, ‘?’, ‘"’, ‘*’, ‘<’, ‘>’, and the control characters in the ranges 0–31 and 128–159. In addition to this, Wget in Windows mode uses ‘+’ instead of ‘:’ to separate host and port in local file names, and uses ‘@’ instead of ‘?’ to separate the query portion of the file name from the rest. Therefore, a URL that would be saved as ‘www.xemacs.org:4300/search.pl?input=blah’ in Unix mode would be saved as ‘www.xemacs.org+4300/search.pl@input=blah’ in Windows mode. This mode is the default on Windows. If you specify ‘nocontrol’, then the escaping of the control characters is also switched off. This option may make sense when you are downloading URLs whose names contain UTF-8 characters, on a system which can save and display filenames in UTF-8 (some possible byte values used in UTF-8 byte sequences fall in the range of values designated by Wget as “controls”) The ‘ascii’ mode is used to specify that any bytes whose values are outside the range of ASCII characters (that is, greater than 127) shall be escaped. This can be useful when saving filenames whose encoding does not match the one used locally ‘-4’‘--inet4-only’‘-6’‘--inet6-only’Force connecting to IPv4 or IPv6 addresses. With ‘--inet4-only’ or ‘-4’, Wget will only connect to IPv4 hosts, ignoring AAAA records in DNS, and refusing to connect to IPv6 addresses specified in URLs. Conversely, with ‘--inet6-only’ or ‘-6’, Wget will only connect to IPv6 hosts and ignore A records and IPv4 addresses Neither options should be needed normally. By default, an IPv6-aware Wget will use the address family specified by the host’s DNS record. If the DNS responds with both IPv4 and IPv6 addresses, Wget will try them in sequence until it finds one it can connect to. (Also see wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/1 option described below. ) These options can be used to deliberately force the use of IPv4 or IPv6 address families on dual family systems, usually to aid debugging or to deal with broken network configuration. Only one of ‘--inet6-only’ and ‘--inet4-only’ may be specified at the same time. Neither option is available in Wget compiled without IPv6 support ‘--prefer-family=none/IPv4/IPv6’When given a choice of several addresses, connect to the addresses with specified address family first. The address order returned by DNS is used without change by default This avoids spurious errors and connect attempts when accessing hosts that resolve to both IPv6 and IPv4 addresses from IPv4 networks. For example, ‘www. kame. net’ resolves to ‘2001. 200. 0. 8002. 203. 47ff. fea5. 3085’ and to ‘203. 178. 141. 194’. When the preferred family is wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/2, the IPv4 address is used first; when the preferred family is wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/3, the IPv6 address is used first; if the specified value is wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/4, the address order returned by DNS is used without change Unlike ‘-4’ and ‘-6’, this option doesn’t inhibit access to any address family, it only changes the order in which the addresses are accessed. Also note that the reordering performed by this option is stable—it doesn’t affect order of addresses of the same family. That is, the relative order of all IPv4 addresses and of all IPv6 addresses remains intact in all cases ‘--retry-connrefused’‘--user=user’‘--password=password’Specify the username user and password password for both FTP and HTTP file retrieval. Các tham số này có thể được ghi đè bằng cách sử dụng các tùy chọn ‘--ftp-user’ và ‘--ftp-password’ cho các kết nối FTP và các tùy chọn ‘--http-user’ và ‘--http-password’ cho các kết nối HTTP ‘--ask-password’Nhắc mật khẩu cho mỗi kết nối được thiết lập. Cannot be specified when ‘--password’ is being used, because they are mutually exclusive ‘--use-askpass=command’Prompt for a user and password using the specified command. If no command is specified then the command in the environment variable WGET_ASKPASS is used. If WGET_ASKPASS is not set then the command in the environment variable SSH_ASKPASS is used You can set the default command for use-askpass in the . wgetrc. That setting may be overridden from the command line ‘--no-iri’Tắt hỗ trợ URI quốc tế hóa (IRI). Sử dụng '--iri' để bật nó lên. Hỗ trợ IRI được kích hoạt theo mặc định Bạn có thể đặt trạng thái hỗ trợ IRI mặc định bằng cách sử dụng lệnh wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/5 trong. wgetrc. That setting may be overridden from the command line‘--local-encoding=encoding’ Force Wget to use encoding as the default system encoding. That affects how Wget converts URLs specified as arguments from locale to UTF-8 for IRI support Wget use the function wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/6 and then the wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/7 environment variable to get the locale. If it fails, ASCII is used You can set the default local encoding using the wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/8 command in . wgetrc. That setting may be overridden from the command line‘--remote-encoding=encoding’ Force Wget to use encoding as the default remote server encoding. That affects how Wget converts URIs found in files from remote encoding to UTF-8 during a recursive fetch. This options is only useful for IRI support, for the interpretation of non-ASCII characters For HTTP, remote encoding can be found in HTTP wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/9 header and in HTML wget --header="Host: foo.bar" http://localhost/0 meta tag You can set the default encoding using the wget --header="Host: foo.bar" http://localhost/1 command in . wgetrc. That setting may be overridden from the command line‘--unlink’ Force Wget to unlink file instead of clobbering existing file. This option is useful for downloading to the directory with hardlinks 2. 6 Directory Options‘-nd’‘--no-directories’Do not create a hierarchy of directories when retrieving recursively. With this option turned on, all files will get saved to the current directory, without clobbering (if a name shows up more than once, the filenames will get extensions ‘. n’) ‘-x’‘--force-directories’The opposite of ‘-nd’—create a hierarchy of directories, even if one would not have been created otherwise. E. g. ‘wget -x http. //fly. srk. fer. hr/robots. txt’ will save the downloaded file to fly. srk. fer. hr/robots. txt ‘-nH’‘--no-host-directories’Disable generation of host-prefixed directories. By default, invoking Wget with ‘-r http. //fly. srk. fer. hr/’ will create a structure of directories beginning with fly. srk. fer. hr/. This option disables such behavior ‘--protocol-directories’Use the protocol name as a directory component of local file names. For example, with this option, ‘wget -r http. //host’ will save to ‘http/host/. ’ rather than just to ‘host/. ’ ‘--cut-dirs=number’Ignore number directory components. This is useful for getting a fine-grained control over the directory where recursive retrieval will be saved Take, for example, the directory at ‘ftp. //ftp. xemacs. org/pub/xemacs/’. If you retrieve it with ‘-r’, it will be saved locally under ftp. xemacs. org/pub/xemacs/. While the ‘-nH’ option can remove the ftp. xemacs. org/, bạn vẫn bị dính pub/xemacs. This is where ‘--cut-dirs’ comes in handy; it makes Wget not “see” number remote directory components. Here are several examples of how ‘--cut-dirs’ option works No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ... If you just want to get rid of the directory structure, this option is similar to a combination of ‘-nd’ and ‘-P’. However, unlike ‘-nd’, ‘--cut-dirs’ does not lose with subdirectories—for instance, with ‘-nH --cut-dirs=1’, a beta/ subdirectory will be placed to xemacs/beta, as one would expect ‘-P prefix’‘--directory-prefix=prefix’Set directory prefix to prefix. The directory prefix is the directory where all other files and subdirectories will be saved to, i. e. the top of the retrieval tree. The default is ‘. ’ (the current directory) 2. 7 HTTP Options‘--default-page=name’Use name as the default file name when it isn’t known (i. e. , for URLs that end in a slash), instead of index. html ‘-E’‘--adjust-extension’‘--http-user=user’‘--http-password=password’Specify the username user and password password on an HTTP server. According to the type of the challenge, Wget will encode them using either the wget --header="Host: foo.bar" http://localhost/2 (insecure), the wget --header="Host: foo.bar" http://localhost/3, or the Windows wget --header="Host: foo.bar" http://localhost/4 authentication scheme Another way to specify username and password is in the URL itself (see ). Either method reveals your password to anyone who bothers to run wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z2. To prevent the passwords from being seen, use the ‘--use-askpass’ or store them in . wgetrc or . netrc, and make sure to protect those files from other users with wget --header="Host: foo.bar" http://localhost/6. If the passwords are really important, do not leave them lying in those files either—edit the files and delete them after Wget has started the download‘--no-http-keep-alive’ Turn off the “keep-alive” feature for HTTP downloads. Normally, Wget asks the server to keep the connection open so that, when you download more than one document from the same server, they get transferred over the same TCP connection. This saves time and at the same time reduces the load on the server This option is useful when, for some reason, persistent (keep-alive) connections don’t work for you, for example due to a server bug or due to the inability of server-side scripts to cope with the connections ‘--no-cache’Disable server-side cache. In this case, Wget will send the remote server appropriate directives (‘Cache-Control. no-cache’ and ‘Pragma. no-cache’) to get the file from the remote service, rather than returning the cached version. This is especially useful for retrieving and flushing out-of-date documents on proxy servers Caching is allowed by default ‘--no-cookies’Disable the use of cookies. Cookies are a mechanism for maintaining server-side state. The server sends the client a cookie using the wget --header="Host: foo.bar" http://localhost/7 header, and the client responds with the same cookie upon further requests. Since cookies allow the server owners to keep track of visitors and for sites to exchange this information, some consider them a breach of privacy. The default is to use cookies; however, storing cookies is not on by default‘--load-cookies file’ Load cookies from file before the first HTTP retrieval. file is a textual file in the format originally used by Netscape’s cookies. txt file You will typically use this option when mirroring sites that require that you be logged in to access some or all of their content. The login process typically works by the web server issuing an HTTP cookie upon receiving and verifying your credentials. The cookie is then resent by the browser when accessing that part of the site, and so proves your identity Mirroring such a site requires Wget to send the same cookies your browser sends when communicating with the site. This is achieved by ‘--load-cookies’—simply point Wget to the location of the cookies. txt file, and it will send the same cookies your browser would send in the same situation. Different browsers keep textual cookie files in different locations Netscape 4. xThe cookies are in ~/. netscape/cookie. txt Mozilla and Netscape 6. xMozilla’s cookie file is also named cookies. txt, located somewhere under ~/. mozilla, trong thư mục hồ sơ của bạn. The full path usually ends up looking somewhat like ~/. mozilla/default/some-weird-string/cookies. txt Internet ExplorerYou can produce a cookie file Wget can use by using the File menu, Import and Export, Export Cookies. This has been tested with Internet Explorer 5; it is not guaranteed to work with earlier versions Other browsersIf you are using a different browser to create your cookies, ‘--load-cookies’ will only work if you can locate or produce a cookie file in the Netscape format that Wget expects If you cannot use ‘--load-cookies’, there might still be an alternative. If your browser supports a “cookie manager”, you can use it to view the cookies used when accessing the site you’re mirroring. Write down the name and value of the cookie, and manually instruct Wget to send those cookies, bypassing the “official” cookie support wget --no-cookies --header "Cookie: name=value"‘--save-cookies file’ Save cookies to file before exiting. This will not save cookies that have expired or that have no expiry time (so-called “session cookies”), but also see ‘--keep-session-cookies’ ‘--keep-session-cookies’‘--ignore-length’‘--header=header-line’Send header-line along with the rest of the headers in each HTTP request. The supplied header is sent as-is, which means it must contain name and value separated by colon, and must not contain newlines You may define more than one additional header by specifying ‘--header’ more than once wget --header='Accept-Charset: iso-8859-2' \ --header='Accept-Language: hr' \ http://fly.srk.fer.hr/ Specification of an empty string as the header value will clear all previous user-defined headers As of Wget 1. 10, this option can be used to override headers otherwise generated automatically. This example instructs Wget to connect to localhost, but to specify ‘foo. bar’ in the wget --header="Host: foo.bar" http://localhost/8 header wget --header="Host: foo.bar" http://localhost/ In versions of Wget prior to 1. 10 such use of ‘--header’ caused sending of duplicate headers ‘--compression=type’Choose the type of compression to be used. Legal values are ‘auto’, ‘gzip’ and ‘none’ If ‘auto’ or ‘gzip’ are specified, Wget asks the server to compress the file using the gzip compression format. If the server compresses the file and responds with the wget --header="Host: foo.bar" http://localhost/9 header field set appropriately, the file will be decompressed automatically If ‘none’ is specified, wget will not ask the server to compress the file and will not decompress any server responses. This is the default Compression support is currently experimental. In case it is turned on, please report any bugs to ftp://user:password@host/path http://user:password@host/path00‘--max-redirect=number’‘--proxy-user=user’‘--proxy-password=password’ Specify the username user and password password for authentication on a proxy server. Wget will encode them using the wget --header="Host: foo.bar" http://localhost/2 authentication scheme Security considerations similar to those with ‘--http-password’ pertain here as well ‘--referer=url’Include ‘Referer. url’ header in HTTP request. Useful for retrieving documents with server-side processing that assume they are always being retrieved by interactive web browsers and only come out properly when Referer is set to one of the pages that point to them ‘--save-headers’Save the headers sent by the HTTP server to the file, preceding the actual contents, with an empty line as the separator ‘-U agent-string’‘--user-agent=agent-string’Identify as agent-string to the HTTP server The HTTP protocol allows the clients to identify themselves using a ftp://user:password@host/path http://user:password@host/path02 header field. This enables distinguishing the WWW software, usually for statistical purposes or for tracing of protocol violations. Wget normally identifies as ‘Wget/version’, version being the current version number of Wget However, some sites have been known to impose the policy of tailoring the output according to the ftp://user:password@host/path http://user:password@host/path02-supplied information. While this is not such a bad idea in theory, it has been abused by servers denying information to clients other than (historically) Netscape or, more frequently, Microsoft Internet Explorer. This option allows you to change the ftp://user:password@host/path http://user:password@host/path02 line issued by Wget. Use of this option is discouraged, unless you really know what you are doing Specifying empty user agent with ‘--user-agent=""’ instructs Wget not to send the ftp://user:password@host/path http://user:password@host/path02 header in HTTP requests‘--post-data=string’‘--post-file=file’ Use POST as the method for all HTTP requests and send the specified data in the request body. ‘--post-data’ sends string as data, whereas ‘--post-file’ sends the contents of file. Other than that, they work in exactly the same way. In particular, they both expect content of the form ftp://user:password@host/path http://user:password@host/path06, with percent-encoding for special characters; the only difference is that one expects its content as a command-line parameter and the other accepts its content from a file. In particular, ‘--post-file’ is not for transmitting files as form attachments. those must appear as ftp://user:password@host/path http://user:password@host/path07 data (with appropriate percent-coding) just like everything else. Wget does not currently support ftp://user:password@host/path http://user:password@host/path08 for transmitting POST data; only ftp://user:password@host/path http://user:password@host/path09. Only one of ‘--post-data’ and ‘--post-file’ should be specified Please note that wget does not require the content to be of the form ftp://user:password@host/path http://user:password@host/path06, and neither does it test for it. Wget will simply transmit whatever data is provided to it. Most servers however expect the POST data to be in the above format when processing HTML Forms When sending a POST request using the ‘--post-file’ option, Wget treats the file as a binary file and will send every character in the POST request without stripping trailing newline or formfeed characters. Any other control characters in the text will also be sent as-is in the POST request Please be aware that Wget needs to know the size of the POST data in advance. Therefore the argument to ftp://user:password@host/path http://user:password@host/path11 must be a regular file; specifying a FIFO or something like /dev/stdin won’t work. It’s not quite clear how to work around this limitation inherent in HTTP/1. 0. Although HTTP/1. 1 introduces chunked transfer that doesn’t require knowing the request length in advance, a client can’t use chunked unless it knows it’s talking to an HTTP/1. 1 server. And it can’t know that until it receives a response, which in turn requires the request to have been completed – a chicken-and-egg problem Note. As of version 1. 15 if Wget is redirected after the POST request is completed, its behaviour will depend on the response code returned by the server. In case of a 301 Moved Permanently, 302 Moved Temporarily or 307 Temporary Redirect, Wget will, in accordance with RFC2616, continue to send a POST request. In case a server wants the client to change the Request method upon redirection, it should send a 303 See Other response code This example shows how to log in to a server using POST and then proceed to download the desired pages, presumably only accessible to authorized users ftp://user:password@host/path http://user:password@host/path0 If the server is using session cookies to track user authentication, the above will not work because ‘--save-cookies’ will not save them (and neither will browsers) and the cookies. txt file will be empty. In that case use ‘--keep-session-cookies’ along with ‘--save-cookies’ to force saving of session cookies ‘--method=HTTP-Method’For the purpose of RESTful scripting, Wget allows sending of other HTTP Methods without the need to explicitly set them using ‘--header=Header-Line’. Wget will use whatever string is passed to it after ‘--method’ as the HTTP Method to the server ‘--body-data=Data-String’‘--body-file=Data-File’Must be set when additional data needs to be sent to the server along with the Method specified using ‘--method’. ‘--body-data’ sends string as data, whereas ‘--body-file’ sends the contents of file. Other than that, they work in exactly the same way Currently, ‘--body-file’ is not for transmitting files as a whole. Wget does not currently support ftp://user:password@host/path http://user:password@host/path08 for transmitting data; only ftp://user:password@host/path http://user:password@host/path09. In the future, this may be changed so that wget sends the ‘--body-file’ as a complete file instead of sending its contents to the server. Please be aware that Wget needs to know the contents of BODY Data in advance, and hence the argument to ‘--body-file’ should be a regular file. See ‘--post-file’ for a more detailed explanation. Only one of ‘--body-data’ and ‘--body-file’ should be specified If Wget is redirected after the request is completed, Wget will suspend the current method and send a GET request till the redirection is completed. This is true for all redirection response codes except 307 Temporary Redirect which is used to explicitly specify that the request method should not change. Another exception is when the method is set to ftp://user:password@host/path http://user:password@host/path14, in which case the redirection rules specified under ‘--post-data’ are followed‘--content-disposition’ If this is set to on, experimental (not fully-functional) support for ftp://user:password@host/path http://user:password@host/path15 headers is enabled. This can currently result in extra round-trips to the server for a ftp://user:password@host/path http://user:password@host/path16 request, and is known to suffer from a few bugs, which is why it is not currently enabled by default This option is useful for some file-downloading CGI programs that use ftp://user:password@host/path http://user:password@host/path15 headers to describe what the name of a downloaded file should be When combined with ‘--metalink-over-http’ and ‘--trust-server-names’, a ‘Content-Type. application/metalink4+xml’ file is named using the ftp://user:password@host/path http://user:password@host/path15 filename field, if available‘--content-on-error’ If this is set to on, wget will not skip the content when the server responds with a http status code that indicates error ‘--trust-server-names’‘--auth-no-challenge’If this option is given, Wget will send Basic HTTP authentication information (plaintext username and password) for all requests, just like Wget 1. 10. 2 and prior did by default Use of this option is not recommended, and is intended only to support some few obscure servers, which never send HTTP authentication challenges, but accept unsolicited auth info, say, in addition to form-based authentication ‘--retry-on-host-error’Consider host errors, such as “Temporary failure in name resolution”, as non-fatal, transient errors ‘--retry-on-http-error=code[,code,. ]’Consider given HTTP response codes as non-fatal, transient errors. Supply a comma-separated list of 3-digit HTTP response codes as argument. Useful to work around special circumstances where retries are required, but the server responds with an error code normally not retried by Wget. Các lỗi như vậy có thể là 503 (Dịch vụ không khả dụng) và 429 (Quá nhiều yêu cầu). Retries enabled by this option are performed subject to the normal retry timing and retry count limitations of Wget Using this option is intended to support special use cases only and is generally not recommended, as it can force retries even in cases where the server is actually trying to decrease its load. Please use wisely and only if you know what you are doing 2. 8 HTTPS (SSL/TLS) OptionsĐể hỗ trợ tải xuống HTTP (HTTPS) được mã hóa, Wget phải được biên dịch bằng thư viện SSL bên ngoài. Mặc định hiện tại là GnuTLS. In addition, Wget also supports HSTS (HTTP Strict Transport Security). If Wget is compiled without SSL support, none of these options are available ‘--secure-protocol=protocol’Choose the secure protocol to be used. Legal values are ‘auto’, ‘SSLv2’, ‘SSLv3’, ‘TLSv1’, ‘TLSv1_1’, ‘TLSv1_2’, ‘TLSv1_3’ and ‘PFS’. If ‘auto’ is used, the SSL library is given the liberty of choosing the appropriate protocol automatically, which is achieved by sending a TLSv1 greeting. This is the default Specifying ‘SSLv2’, ‘SSLv3’, ‘TLSv1’, ‘TLSv1_1’, ‘TLSv1_2’ or ‘TLSv1_3’ forces the use of the corresponding protocol. This is useful when talking to old and buggy SSL server implementations that make it hard for the underlying SSL library to choose the correct protocol version. Fortunately, such servers are quite rare Specifying ‘PFS’ enforces the use of the so-called Perfect Forward Security cipher suites. In short, PFS adds security by creating a one-time key for each SSL connection. It has a bit more CPU impact on client and server. We use known to be secure ciphers (e. g. no MD4) and the TLS protocol. This mode also explicitly excludes non-PFS key exchange methods, such as RSA ‘--https-only’When in recursive mode, only HTTPS links are followed ‘--ciphers’‘--no-check-certificate’‘--certificate=file’‘--certificate-type=type’Specify the type of the client certificate. Legal values are ‘PEM’ (assumed by default) and ‘DER’, also known as ‘ASN1’ ‘--private-key=file’Read the private key from file. This allows you to provide the private key in a file separate from the certificate ‘--private-key-type=type’Specify the type of the private key. Accepted values are ‘PEM’ (the default) and ‘DER’ ‘--ca-certificate=file’‘--ca-directory=directory’‘--crl-file=file’Specifies a CRL file in file. This is needed for certificates that have been revocated by the CAs ‘--pinnedpubkey=file/hashes’Tells wget to use the specified public key file (or hashes) to verify the peer. This can be a path to a file which contains a single public key in PEM or DER format, or any number of base64 encoded sha256 hashes preceded by “sha256//” and separated by “;” When negotiating a TLS or SSL connection, the server sends a certificate indicating its identity. A public key is extracted from this certificate and if it does not exactly match the public key(s) provided to this option, wget will abort the connection before sending or receiving any data ‘--random-file=file’[OpenSSL and LibreSSL only] Use file as the source of random data for seeding the pseudo-random number generator on systems without /dev/urandom On such systems the SSL library needs an external source of randomness to initialize. Randomness may be provided by EGD (see ‘--egd-file’ below) or read from an external source specified by the user. If this option is not specified, Wget looks for random data in ftp://user:password@host/path http://user:password@host/path19 or, if that is unset, in $HOME/. rnd If you’re getting the “Could not seed OpenSSL PRNG; disabling SSL. ” error, you should provide random data using some of the methods described above ‘--egd-file=file’[OpenSSL only] Use file as the EGD socket. EGD stands for Entropy Gathering Daemon, a user-space program that collects data from various unpredictable system sources and makes it available to other programs that might need it. Encryption software, such as the SSL library, needs sources of non-repeating randomness to seed the random number generator used to produce cryptographically strong keys OpenSSL allows the user to specify his own source of entropy using the ftp://user:password@host/path http://user:password@host/path20 environment variable. If this variable is unset, or if the specified file does not produce enough randomness, OpenSSL will read random data from EGD socket specified using this option If this option is not specified (and the equivalent startup command is not used), EGD is never contacted. EGD is not needed on modern Unix systems that support /dev/urandom ‘--no-hsts’Wget supports HSTS (HTTP Strict Transport Security, RFC 6797) by default. Use ‘--no-hsts’ to make Wget act as a non-HSTS-compliant UA. As a consequence, Wget would ignore all the ftp://user:password@host/path http://user:password@host/path21 headers, and would not enforce any existing HSTS policy‘--hsts-file=file’ By default, Wget stores its HSTS database in ~/. wget-hsts. You can use ‘--hsts-file’ to override this. Wget will use the supplied file as the HSTS database. Such file must conform to the correct HSTS database format used by Wget. If Wget cannot parse the provided file, the behaviour is unspecified The Wget’s HSTS database is a plain text file. Each line contains an HSTS entry (ie. a site that has issued a ftp://user:password@host/path http://user:password@host/path21 header and that therefore has specified a concrete HSTS policy to be applied). Lines starting with a dash ( ftp://user:password@host/path http://user:password@host/path23) are ignored by Wget. Please note that in spite of this convenient human-readability hand-hacking the HSTS database is generally not a good idea An HSTS entry line consists of several fields separated by one or more whitespace ftp://user:password@host/path http://user:password@host/path24 The hostname and port fields indicate the hostname and port to which the given HSTS policy applies. The port field may be zero, and it will, in most of the cases. That means that the port number will not be taken into account when deciding whether such HSTS policy should be applied on a given request (only the hostname will be evaluated). When port is different to zero, both the target hostname and the port will be evaluated and the HSTS policy will only be applied if both of them match. This feature has been included for testing/development purposes only. The Wget testsuite (in testenv/) creates HSTS databases with explicit ports with the purpose of ensuring Wget’s correct behaviour. Applying HSTS policies to ports other than the default ones is discouraged by RFC 6797 (see Appendix B "Differences between HSTS Policy and Same-Origin Policy"). Thus, this functionality should not be used in production environments and port will typically be zero. The last three fields do what they are expected to. The field include_subdomains can either be ftp://user:password@host/path http://user:password@host/path25 or ftp://user:password@host/path http://user:password@host/path26 and it signals whether the subdomains of the target domain should be part of the given HSTS policy as well. The created and max-age fields hold the timestamp values of when such entry was created (first seen by Wget) and the HSTS-defined value ’max-age’, which states how long should that HSTS policy remain active, measured in seconds elapsed since the timestamp stored in created. Once that time has passed, that HSTS policy will no longer be valid and will eventually be removed from the database If you supply your own HSTS database via ‘--hsts-file’, be aware that Wget may modify the provided file if any change occurs between the HSTS policies requested by the remote servers and those in the file. When Wget exits, it effectively updates the HSTS database by rewriting the database file with the new entries If the supplied file does not exist, Wget will create one. This file will contain the new HSTS entries. If no HSTS entries were generated (no ftp://user:password@host/path http://user:password@host/path21 headers were sent by any of the servers) then no file will be created, not even an empty one. This behaviour applies to the default database file (~/. wget-hsts) as well. it will not be created until some server enforces an HSTS policy Care is taken not to override possible changes made by other Wget processes at the same time over the HSTS database. Before dumping the updated HSTS entries on the file, Wget will re-read it and merge the changes Using a custom HSTS database and/or modifying an existing one is discouraged. For more information about the potential security threats arose from such practice, see section 14 "Security Considerations" of RFC 6797, specially section 14. 9 "Creative Manipulation of HSTS Policy Store" '--warc-tệp=tệp'Sử dụng tệp làm tệp WARC đích ‘--warc-header=string’Use string into as the warcinfo record ‘--warc-max-size=size’Set the maximum size of the WARC files to size ‘--warc-cdx’Write CDX index files '--warc-dedup=tệp'Do not store records listed in this CDX file ‘--no-warc-compression’Do not compress WARC files with GZIP ‘--no-warc-digests’Do not calculate SHA1 digests ‘--no-warc-keep-log’Do not store the log file in a WARC record ‘--warc-tempdir=dir’Specify the location for temporary files created by the WARC writer 2. 9 FTP Options‘--ftp-user=user’‘--ftp-password=password’Specify the username user and password password on an FTP server. Without this, or the corresponding startup option, the password defaults to ‘-wget@’, normally used for anonymous FTP Another way to specify username and password is in the URL itself (see ). Either method reveals your password to anyone who bothers to run wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z2. To prevent the passwords from being seen, store them in . wgetrc or . netrc, and make sure to protect those files from other users with wget --header="Host: foo.bar" http://localhost/6. If the passwords are really important, do not leave them lying in those files either—edit the files and delete them after Wget has started the download‘--no-remove-listing’ Don’t remove the temporary . listing files generated by FTP retrievals. Normally, these files contain the raw directory listings received from FTP servers. Not removing them can be useful for debugging purposes, or when you want to be able to easily check on the contents of remote server directories (e. g. to verify that a mirror you’re running is complete) Note that even though Wget writes to a known filename for this file, this is not a security hole in the scenario of a user making . listing a symbolic link to /etc/passwd or something and asking ftp://user:password@host/path http://user:password@host/path30 to run Wget in his or her directory. Depending on the options used, either Wget will refuse to write to . listing, making the globbing/recursion/time-stamping operation fail, or the symbolic link will be deleted and replaced with the actual . listing file, or the listing will be written to a . listing. number file Even though this situation isn’t a problem, though, ftp://user:password@host/path http://user:password@host/path30 should never run Wget in a non-trusted user’s directory. A user could do something as simple as linking index. html to /etc/passwd and asking ftp://user:password@host/path http://user:password@host/path30 to run Wget with ‘-N’ or ‘-r’ so the file will be overwritten‘--no-glob’ Turn off FTP globbing. Globbing refers to the use of shell-like special characters (wildcards), like ‘*’, ‘?’, ‘[’ and ‘]’ to retrieve more than one file from the same directory at once, like ftp://user:password@host/path http://user:password@host/path1 By default, globbing will be turned on if the URL contains a globbing character. This option may be used to turn globbing on or off permanently You may have to quote the URL to protect it from being expanded by your shell. Globbing makes Wget look for a directory listing, which is system-specific. This is why it currently works only with Unix FTP servers (and the ones emulating Unix ftp://user:password@host/path http://user:password@host/path33 output)‘--no-passive-ftp’ Disable the use of the passive FTP transfer mode. Passive FTP mandates that the client connect to the server to establish the data connection rather than the other way around If the machine is connected to the Internet directly, both passive and active FTP should work equally well. Behind most firewall and NAT configurations passive FTP has a better chance of working. However, in some rare firewall configurations, active FTP actually works when passive FTP doesn’t. If you suspect this to be the case, use this option, or set ftp://user:password@host/path http://user:password@host/path34 in your init file‘--preserve-permissions’‘--retr-symlinks’ By default, when retrieving FTP directories recursively and a symbolic link is encountered, the symbolic link is traversed and the pointed-to files are retrieved. Currently, Wget does not traverse symbolic links to directories to download them recursively, though this feature may be added in the future When ‘--retr-symlinks=no’ is specified, the linked-to file is not downloaded. Instead, a matching symbolic link is created on the local filesystem. The pointed-to file will not be retrieved unless this recursive retrieval would have encountered it separately and downloaded it anyway. This option poses a security risk where a malicious FTP Server may cause Wget to write to files outside of the intended directories through a specially crafted . LISTING file Note that when retrieving a file (not a directory) because it was specified on the command-line, rather than because it was recursed to, this option has no effect. Symbolic links are always traversed in this case 2. 10 FTPS Options‘--ftps-implicit’This option tells Wget to use FTPS implicitly. Implicit FTPS consists of initializing SSL/TLS from the very beginning of the control connection. This option does not send an ftp://user:password@host/path http://user:password@host/path35 command. it assumes the server speaks FTPS and directly starts an SSL/TLS connection. If the attempt is successful, the session continues just like regular FTPS ( ftp://user:password@host/path http://user:password@host/path36 and ftp://user:password@host/path http://user:password@host/path37 are sent, etc. ). Implicit FTPS is no longer a requirement for FTPS implementations, and thus many servers may not support it. If ‘--ftps-implicit’ is passed and no explicit port number specified, the default port for implicit FTPS, 990, will be used, instead of the default port for the "normal" (explicit) FTPS which is the same as that of FTP, 21‘--no-ftps-resume-ssl’ Do not resume the SSL/TLS session in the data channel. When starting a data connection, Wget tries to resume the SSL/TLS session previously started in the control connection. SSL/TLS session resumption avoids performing an entirely new handshake by reusing the SSL/TLS parameters of a previous session. Typically, the FTPS servers want it that way, so Wget does this by default. Under rare circumstances however, one might want to start an entirely new SSL/TLS session in every data connection. This is what ‘--no-ftps-resume-ssl’ is for ‘--ftps-clear-data-connection’All the data connections will be in plain text. Only the control connection will be under SSL/TLS. Wget will send a ftp://user:password@host/path http://user:password@host/path38 command to achieve this, which must be approved by the server‘--ftps-fallback-to-ftp’ Fall back to FTP if FTPS is not supported by the target server. For security reasons, this option is not asserted by default. The default behaviour is to exit with an error. If a server does not successfully reply to the initial ftp://user:password@host/path http://user:password@host/path35 command, or in the case of implicit FTPS, if the initial SSL/TLS connection attempt is rejected, it is considered that such server does not support FTPS 2. 11 Recursive Retrieval Options‘-r’‘--recursive’Turn on recursive retrieving. See , for more details. The default maximum depth is 5 ‘-l depth’‘--level=depth’Set the maximum number of subdirectories that Wget will recurse into to depth. In order to prevent one from accidentally downloading very large websites when using recursion this is limited to a depth of 5 by default, i. e. , it will traverse at most 5 directories deep starting from the provided URL. Set ‘-l 0’ or ‘-l inf’ for infinite recursion depth ftp://user:password@host/path http://user:password@host/path2 Ideally, one would expect this to download just 1. html. but unfortunately this is not the case, because ‘-l 0’ is equivalent to ‘-l inf’—that is, infinite recursion. To download a single HTML page (or a handful of them), specify them all on the command line and leave away ‘-r’ and ‘-l’. To download the essential items to view a single HTML page, see ‘page requisites’ ‘--delete-after’‘-k’‘--convert-links’After the download is complete, convert the links in the document to make them suitable for local viewing. This affects not only the visible hyperlinks, but any part of the document that links to external content, such as embedded images, links to style sheets, hyperlinks to non-HTML content, etc Mỗi liên kết sẽ được thay đổi theo một trong hai cách
Because of this, local browsing works reliably. if a linked file was downloaded, the link will refer to its local name; if it was not downloaded, the link will refer to its full Internet address rather than presenting a broken link. The fact that the former links are converted to relative links ensures that you can move the downloaded hierarchy to another directory Note that only at the end of the download can Wget know which links have been downloaded. Because of that, the work done by ‘-k’ will be performed at the end of all the downloads ‘--convert-file-only’This option converts only the filename part of the URLs, leaving the rest of the URLs untouched. This filename part is sometimes referred to as the "basename", although we avoid that term here in order not to cause confusion It works particularly well in conjunction with ‘--adjust-extension’, although this coupling is not enforced. It proves useful to populate Internet caches with files downloaded from different hosts Example. if some link points to //foo. com/bar. cgi?xyz with ‘--adjust-extension’ asserted and its local destination is intended to be . /foo. com/bar. cgi?xyz. css, then the link would be converted to //foo. com/bar. cgi?xyz. css. Note that only the filename part has been modified. The rest of the URL has been left untouched, including the net path ( ftp://user:password@host/path http://user:password@host/path40) which would otherwise be processed by Wget and converted to the effective scheme (ie. ftp://user:password@host/path http://user:password@host/path41)‘-K’‘--backup-converted’ When converting a file, back up the original version with a ‘. orig’ suffix. Affects the behavior of ‘-N’ (see ) ‘-m’‘--mirror’Turn on options suitable for mirroring. This option turns on recursion and time-stamping, sets infinite recursion depth and keeps FTP directory listings. It is currently equivalent to ‘-r -N -l inf --no-remove-listing’ ‘-p’‘--page-requisites’‘--strict-comments’Turn on strict parsing of HTML comments. The default is to terminate comments at the first occurrence of ‘-->’ According to specifications, HTML comments are expressed as SGML declarations. Declaration is special markup that begins with ‘’ and ends with ‘>’, such as ‘’, that may contain comments between a pair of ‘--’ delimiters. HTML comments are “empty declarations”, SGML declarations without any non-comment text. Therefore, ‘’ is a valid comment, and so is ‘’, but ‘’ is not On the other hand, most HTML writers don’t perceive comments as anything other than text delimited with ‘’, which is not quite the same. For example, something like ‘’ works as a valid comment as long as the number of dashes is a multiple of four (. ). If not, the comment technically lasts until the next ‘--’, which may be at the other end of the document. Because of this, many popular browsers completely ignore the specification and implement what users have come to expect. comments delimited with ‘’ Until version 1. 9, Wget interpreted comments strictly, which resulted in missing links in many web pages that displayed fine in browsers, but had the misfortune of containing non-compliant comments. Beginning with version 1. 9, Wget has joined the ranks of clients that implements “naive” comments, terminating each comment at the first occurrence of ‘-->’ If, for whatever reason, you want strict comment parsing, use this option to turn it on 2. 12 Recursive Accept/Reject Options‘-A acclist --accept acclist’‘-R rejlist --reject rejlist’Specify comma-separated lists of file name suffixes or patterns to accept or reject (see ). Note that if any of the wildcard characters, ‘*’, ‘?’, ‘[’ or ‘]’, appear in an element of acclist or rejlist, it will be treated as a pattern, rather than a suffix. In this case, you have to enclose the pattern into quotes to prevent your shell from expanding it, like in ‘-A "*. mp3"’ or ‘-A '*. mp3'’ ‘--accept-regex urlregex’‘--reject-regex urlregex’Specify a regular expression to accept or reject the complete URL ‘--regex-type regextype’Specify the regular expression type. Possible types are ‘posix’ or ‘pcre’. Note that to be able to use ‘pcre’ type, wget has to be compiled with libpcre support ‘-D domain-list’‘--domains=domain-list’Set domains to be followed. domain-list is a comma-separated list of domains. Note that it does not turn on ‘-H’ ‘--exclude-domains domain-list’‘--follow-ftp’Follow FTP links from HTML documents. Without this option, Wget will ignore all the FTP links ‘--follow-tags=list’Wget has an internal table of HTML tag / attribute pairs that it considers when looking for linked documents during a recursive retrieval. If a user wants only a subset of those tags to be considered, however, he or she should be specify such tags in a comma-separated list with this option ‘--ignore-tags=list’‘--ignore-case’Ignore case when matching files and directories. This influences the behavior of -R, -A, -I, and -X options, as well as globbing implemented when downloading from FTP sites. For example, with this option, ‘-A "*. txt"’ will match ‘file1. txt’, but also ‘file2. TXT’, ‘file3. TxT’, and so on. The quotes in the example are to prevent the shell from expanding the pattern ‘-H’‘--span-hosts’Enable spanning across hosts when doing recursive retrieving (see ) ‘-L’‘--relative’Follow relative links only. Hữu ích khi truy xuất một trang chủ cụ thể mà không có bất kỳ phiền nhiễu nào, kể cả những trang từ cùng một máy chủ (xem phần ) ‘-I list’‘--include-directories=list’Specify a comma-separated list of directories you wish to follow when downloading (see ). Elements of list may contain wildcards ‘-X list’‘--exclude-directories=list’Chỉ định danh sách các thư mục được phân tách bằng dấu phẩy mà bạn muốn loại trừ khỏi quá trình tải xuống (xem ). Các phần tử của danh sách có thể chứa ký tự đại diện ‘-np’‘--no-parent’Do not ever ascend to the parent directory when retrieving recursively. This is a useful option, since it guarantees that only the files below a certain hierarchy will be downloaded. See , for more details 2. 13 Trạng thái thoátWget may return one of several error codes if it encounters problems 0No problems occurred 1Generic error code 2Parse error—for instance, when parsing command-line options, the ‘. wgetrc’ or ‘. netrc’ 3File I/O error 4Network failure 5SSL verification failure 6Username/password authentication failure 7Protocol errors 8Server issued an error response With the exceptions of 0 and 1, the lower-numbered exit codes take precedence over higher-numbered ones, when multiple types of errors are encountered In versions of Wget prior to 1. 12, Wget’s exit status tended to be unhelpful and inconsistent. Recursive downloads would virtually always return 0 (success), regardless of any issues encountered, and non-recursive fetches only returned the status corresponding to the most recently-attempted download 3 Recursive DownloadGNU Wget is capable of traversing parts of the Web (or a single HTTP or FTP server), following links and directory structure. We refer to this as to recursive retrieval, or recursion With HTTP URLs, Wget retrieves and parses the HTML or CSS from the given URL, retrieving the files the document refers to, through markup like No options -> ftp.xemacs.org/pub/xemacs/ -nH -> pub/xemacs/ -nH --cut-dirs=1 -> xemacs/ -nH --cut-dirs=2 -> . --cut-dirs=1 -> ftp.xemacs.org/xemacs/ ...4 or ftp://user:password@host/path http://user:password@host/path43, or CSS URI values specified using the ‘url()’ functional notation. If the freshly downloaded file is also of type ftp://user:password@host/path http://user:password@host/path44, ftp://user:password@host/path http://user:password@host/path45, or ftp://user:password@host/path http://user:password@host/path46, it will be parsed and followed further Recursive retrieval of HTTP and HTML/CSS content is breadth-first. This means that Wget first downloads the requested document, then the documents linked from that document, then the documents linked by them, and so on. In other words, Wget first downloads the documents at depth 1, then those at depth 2, and so on until the specified maximum depth The maximum depth to which the retrieval may descend is specified with the ‘-l’ option. The default maximum depth is five layers When retrieving an FTP URL recursively, Wget will retrieve all the data from the given directory tree (including the subdirectories up to the specified depth) on the remote server, creating its mirror image locally. FTP retrieval is also limited by the ftp://user:password@host/path http://user:password@host/path47 parameter. Unlike HTTP recursion, FTP recursion is performed depth-first By default, Wget will create a local directory tree, corresponding to the one found on the remote server Recursive retrieving can find a number of applications, the most important of which is mirroring. It is also useful for WWW presentations, and any other opportunities where slow network connections should be bypassed by storing the files locally You should be warned that recursive downloads can overload the remote servers. Because of that, many administrators frown upon them and may ban access from your site if they detect very fast downloads of big amounts of content. When downloading from Internet servers, consider using the ‘-w’ option to introduce a delay between accesses to the server. The download will take a while longer, but the server administrator will not be alarmed by your rudeness Of course, recursive download may cause problems on your machine. If left to run unchecked, it can easily fill up the disk. If downloading from local network, it can also take bandwidth on the system, as well as consume memory and CPU Try to specify the criteria that match the kind of download you are trying to achieve. If you want to download only one page, use ‘--page-requisites’ without any additional recursion. If you want to download things under one directory, use ‘-np’ to avoid downloading things from other directories. If you want to download all the files from one directory, use ‘-l 1’ to make sure the recursion depth never exceeds one. See , for more information about this Recursive retrieval should be used with care. Don’t say you were not warned 4 Following LinksWhen retrieving recursively, one does not wish to retrieve loads of unnecessary data. Most of the time the users bear in mind exactly what they want to download, and want Wget to follow only specific links For example, if you wish to download the music archive from ‘fly. srk. fer. hr’, you will not want to download all the home pages that happen to be referenced by an obscure part of the archive Wget possesses several mechanisms that allows you to fine-tune which links it will follow 4. 1 máy chủ kéo dàiWget’s recursive retrieval normally refuses to visit hosts different than the one you specified on the command line. This is a reasonable default; without it, every retrieval would have the potential to turn your Wget into a small version of google However, visiting different hosts, or host spanning, is sometimes a useful option. Maybe the images are served from a different server. Maybe you’re mirroring a site that consists of pages interlinked between three servers. Maybe the server has two equivalent names, and the HTML pages refer to both interchangeably Span to any host—‘-H’The ‘-H’ option turns on host spanning, thus allowing Wget’s recursive run to visit any host referenced by a link. Unless sufficient recursion-limiting criteria are applied depth, these foreign hosts will typically link to yet more hosts, and so on until Wget ends up sucking up much more data than you have intended Limit spanning to certain domains—‘-D’The ‘-D’ option allows you to specify the domains that will be followed, thus limiting the recursion only to the hosts that belong to these domains. Obviously, this makes sense only in conjunction with ‘-H’. A typical example would be downloading the contents of ‘www. example. com’, but allowing downloads from ‘images. example. com’, etc ftp://user:password@host/path http://user:password@host/path3 You can specify more than one address by separating them with a comma, e. g. ‘-Ddomain1. com,domain2. com’ Keep download off certain domains—‘--exclude-domains’If there are domains you want to exclude specifically, you can do it with ‘--exclude-domains’, which accepts the same type of arguments of ‘-D’, but will exclude all the listed domains. Ví dụ: nếu bạn muốn tải xuống tất cả các máy chủ lưu trữ từ 'foo. edu’, ngoại trừ ‘sunsite. foo. edu’, you can do it like this ftp://user:password@host/path http://user:password@host/path4 4. 2 Types of FilesWhen downloading material from the web, you will often want to restrict the retrieval to only certain file types. For example, if you are interested in downloading GIFs, you will not be overjoyed to get loads of PostScript documents, and vice versa Wget offers two options to deal with this problem. Each option description lists a short name, a long name, and the equivalent command in . wgetrc ‘-A acclist’‘--accept acclist’‘accept = acclist’‘--accept-regex urlregex’‘accept-regex = urlregex’The argument to ‘--accept’ option is a list of file suffixes or patterns that Wget will download during recursive retrieval. Hậu tố là phần kết thúc của một tệp và bao gồm các chữ cái "bình thường", e. g. 'gif' hoặc '. jpg'. Một mẫu phù hợp chứa các ký tự đại diện giống như vỏ, e. g. 'sách*' hoặc 'zelazny*196[0-9]*' So, specifying ‘wget -A gif,jpg’ will make Wget download only the files ending with ‘gif’ or ‘jpg’, i. e. GIF và JPEG. Mặt khác, ‘wget -A "zelazny*196[0-9]*"' sẽ chỉ tải xuống các tệp bắt đầu bằng 'zelazny' và chứa các số từ 1960 đến 1969 ở bất kỳ đâu trong. Tra cứu hướng dẫn sử dụng shell của bạn để biết mô tả về cách thức hoạt động của khớp mẫu Tất nhiên, bất kỳ số lượng hậu tố và mẫu nào cũng có thể được kết hợp thành một danh sách được phân tách bằng dấu phẩy và được đưa ra làm đối số cho '-A' Đối số cho tùy chọn '--accept-regex' là một biểu thức chính quy được khớp với URL hoàn chỉnh ‘-R rejlist’‘--reject rejlist’‘reject = rejlist’‘--reject-regex urlregex’‘reject-regex = urlregex’Tùy chọn '--reject' hoạt động giống như tùy chọn '--accept', chỉ có logic của nó là ngược lại; Vì vậy, nếu bạn muốn tải xuống toàn bộ trang ngoại trừ MPEG và. AU, bạn có thể sử dụng 'wget -R mpg,mpeg,au'. Tương tự, để tải xuống tất cả các tệp ngoại trừ những tệp bắt đầu bằng ‘bjork’, hãy sử dụng ‘wget -R "bjork*"'. Các dấu ngoặc kép là để ngăn chặn sự mở rộng của shell Đối số cho tùy chọn '--accept-regex' là một biểu thức chính quy được khớp với URL hoàn chỉnh Các tùy chọn '-A' và '-R' có thể được kết hợp để đạt được khả năng tinh chỉnh tốt hơn nữa đối với các tệp cần truy xuất. e. g. ‘wget -A "*zelazny*" -R. ps' sẽ tải xuống tất cả các tệp có 'zelazny' như một phần tên của chúng, nhưng không tải xuống các tệp PostScript Lưu ý rằng hai tùy chọn này không ảnh hưởng đến việc tải xuống tệp HTML (như được xác định bởi dấu ‘. htm' hoặc '. html’ filename prefix). This behavior may not be desirable for all users, and may be changed for future versions of Wget Note, too, that query strings (strings at the end of a URL beginning with a question mark (‘?’) are not included as part of the filename for accept/reject rules, even though these will actually contribute to the name chosen for the local file. It is expected that a future version of Wget will provide an option to allow matching against query strings Finally, it’s worth noting that the accept/reject lists are matched twice against downloaded files. once against the URL’s filename portion, to determine if the file should be downloaded in the first place; then, after it has been accepted and successfully downloaded, the local file’s name is also checked against the accept/reject lists to see if it should be removed. The rationale was that, since ‘. htm’ and ‘. html’ files are always downloaded regardless of accept/reject rules, they should be removed after being downloaded and scanned for links, if they did match the accept/reject lists. However, this can lead to unexpected results, since the local filenames can differ from the original URL filenames in the following ways, all of which can change whether an accept/reject rule matches
This behavior, too, is considered less-than-desirable, and may change in a future version of Wget 4. 3 Directory-Based LimitsRegardless of other link-following facilities, it is often useful to place the restriction of what files to retrieve based on the directories those files are placed in. There can be many reasons for this—the home pages may be organized in a reasonable directory structure; or some directories may contain useless information, e. g. /cgi-bin or /dev directories Wget offers three different options to deal with this requirement. Each option description lists a short name, a long name, and the equivalent command in . wgetrc ‘-I list’‘--include list’‘include_directories = list’‘-I’ option accepts a comma-separated list of directories included in the retrieval. Any other directories will simply be ignored. The directories are absolute paths So, if you wish to download from ‘http. //host/people/bozo/’ following only links to bozo’s colleagues in the /people directory and the bogus scripts in /cgi-bin, you can specify ftp://user:password@host/path http://user:password@host/path5‘-X list’‘--exclude list’‘exclude_directories = list’ ‘-X’ option is exactly the reverse of ‘-I’—this is a list of directories excluded from the download. E. g. if you do not want Wget to download things from /cgi-bin directory, specify ‘-X /cgi-bin’ on the command line The same as with ‘-A’/‘-R’, these two options can be combined to get a better fine-tuning of downloading subdirectories. E. g. if you want to load all the files from /pub hierarchy except for /pub/worthless, specify ‘-I/pub -X/pub/worthless’ ‘-np’‘--no-parent’‘no_parent = on’The simplest, and often very useful way of limiting directories is disallowing retrieval of the links that refer to the hierarchy above than the beginning directory, i. e. disallowing ascent to the parent directory/directories The ‘--no-parent’ option (short ‘-np’) is useful in this case. Using it guarantees that you will never leave the existing hierarchy. Supposing you issue Wget with ftp://user:password@host/path http://user:password@host/path6 You may rest assured that none of the references to /~his-girls-homepage/ or /~luzer/all-my-mpegs/ will be followed. Only the archive you are interested in will be downloaded. Essentially, ‘--no-parent’ is similar to ‘-I/~luzer/my-archive’, only it handles redirections in a more intelligent fashion Note that, for HTTP (and HTTPS), the trailing slash is very important to ‘--no-parent’. HTTP has no concept of a “directory”—Wget relies on you to indicate what’s a directory and what isn’t. In ‘http. //foo/bar/’, Wget will consider ‘bar’ to be a directory, while in ‘http. //foo/bar’ (no trailing slash), ‘bar’ will be considered a filename (so ‘--no-parent’ would be meaningless, as its parent is ‘/’) 4. 4 Relative LinksWhen ‘-L’ is turned on, only the relative links are ever followed. Relative links are here defined those that do not refer to the web server root. For example, these links are relative ftp://user:password@host/path http://user:password@host/path7 These links are not relative ftp://user:password@host/path http://user:password@host/path8 Using this option guarantees that recursive retrieval will not span hosts, even without ‘-H’. In simple cases it also allows downloads to “just work” without having to convert links This option is probably not very useful and might be removed in a future release 4. 5 Following FTP LinksThe rules for FTP are somewhat specific, as it is necessary for them to be. FTP links in HTML documents are often included for purposes of reference, and it is often inconvenient to download them by default To have FTP links followed from HTML documents, you need to specify the ‘--follow-ftp’ option. Having done that, FTP links will span hosts regardless of ‘-H’ setting. This is logical, as FTP links rarely point to the same host where the HTTP server resides. Vì những lý do tương tự, các tùy chọn '-L' không ảnh hưởng đến các lượt tải xuống đó. On the other hand, domain acceptance (‘-D’) and suffix rules (‘-A’ and ‘-R’) apply normally Also note that followed links to FTP directories will not be retrieved recursively further 5 Time-StampingOne of the most important aspects of mirroring information from the Internet is updating your archives Tải đi tải lại toàn bộ kho lưu trữ, chỉ để thay thế một vài tệp đã thay đổi là rất tốn kém, cả về lãng phí băng thông và tiền bạc cũng như thời gian để cập nhật. 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
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 ftp://user:password@host/path http://user:password@host/path48 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 5. 1 Time-Stamping UsageThe usage of time-stamping is simple. Say you would like to download a file so that it keeps its date of modification ftp://user:password@host/path http://user:password@host/path9 A simple ftp://user:password@host/path http://user:password@host/path49 shows that the time stamp on the local file equals the state of the ftp://user:password@host/path http://user:password@host/path50 header, as returned by the server. As you can see, the time-stamping info is preserved locally, even without ‘-N’ (at least for HTTP) Several days later, you would like Wget to check if the remote file has changed, and download it if it has ftp://host/directory/file;type=a0 Wget will ask the server for the last-modified date. If the local file has the same timestamp as the server, or a newer one, the remote file will not be re-fetched. However, if the remote file is more recent, Wget will proceed to fetch it The same goes for FTP. For example ftp://host/directory/file;type=a1 (The quotes around that URL are to prevent the shell from trying to interpret the ‘*’. ) After download, a local directory listing will show that the timestamps match those on the remote server. Reissuing the command with ‘-N’ will make Wget re-fetch only the files that have been modified since the last download If you wished to mirror the GNU archive every week, you would use a command like the following, weekly ftp://host/directory/file;type=a2 Note that time-stamping will only work for files for which the server gives a timestamp. For HTTP, this depends on getting a ftp://user:password@host/path http://user:password@host/path50 header. For FTP, this depends on getting a directory listing with dates in a format that Wget can parse (see ) 5. 2 HTTP Time-Stamping InternalsTime-stamping in HTTP is implemented by checking of the ftp://user:password@host/path http://user:password@host/path50 header. If you wish to retrieve the file foo. html through HTTP, Wget will check whether foo. html exists locally. If it doesn’t, foo. html will be retrieved unconditionally If the file does exist locally, Wget will first check its local time-stamp (similar to the way ftp://user:password@host/path http://user:password@host/path49 checks it), and then send a ftp://user:password@host/path http://user:password@host/path16 request to the remote server, demanding the information on the remote file The ftp://user:password@host/path http://user:password@host/path50 header is examined to find which file was modified more recently (which makes it “newer”). If the remote file is newer, it will be downloaded; if it is older, Wget will give up When ‘--backup-converted’ (‘-K’) is specified in conjunction with ‘-N’, server file ‘X’ is compared to local file ‘X. orig’, if extant, rather than being compared to local file ‘X’, which will always differ if it’s been converted by ‘--convert-links’ (‘-k’) Arguably, HTTP time-stamping should be implemented using the ftp://user:password@host/path http://user:password@host/path56 request 5. 3 FTP Time-Stamping InternalsVề lý thuyết, tem thời gian của FTP hoạt động giống như HTTP, chỉ khác là FTP không có tiêu đề—dấu thời gian phải được đưa ra khỏi danh sách thư mục If an FTP download is recursive or uses globbing, Wget will use the FTP ftp://user:password@host/path http://user:password@host/path57 command to get a file listing for the directory containing the desired file(s). It will try to analyze the listing, treating it like Unix ftp://user:password@host/path http://user:password@host/path49 output, extracting the time-stamps. The rest is exactly the same as for HTTP. Note that when retrieving individual files from an FTP server without using globbing or recursion, listing files will not be downloaded (and thus files will not be time-stamped) unless ‘-N’ is specified Assumption that every directory listing is a Unix-style listing may sound extremely constraining, but in practice it is not, as many non-Unix FTP servers use the Unixoid listing format because most (all?) of the clients understand it. Bear in mind that RFC959 defines no standard way to get a file list, let alone the time-stamps. We can only hope that a future standard will define this Another non-standard solution includes the use of ftp://user:password@host/path http://user:password@host/path59 command that is supported by some FTP servers (including the popular ftp://user:password@host/path http://user:password@host/path60), which returns the exact time of the specified file. Wget may support this command in the future 6 Startup FileOnce you know how to change default settings of Wget through command line arguments, you may wish to make some of those settings permanent. You can do that in a convenient way by creating the Wget startup file—. wgetrc Besides . wgetrc is the “main” initialization file, it is convenient to have a special facility for storing passwords. Thus Wget reads and interprets the contents of $HOME/. netrc, if it finds it. You can find . netrc format in your system manuals Wget reads . wgetrc upon startup, recognizing a limited set of commands 6. 1 Wgetrc LocationWhen initializing, Wget will look for a global startup file, /usr/local/etc/wgetrc by default (or some prefix other than /usr/local, if Wget was not installed there) and read commands from there, if it exists Then it will look for the user’s file. If the environmental variable ftp://user:password@host/path http://user:password@host/path61 is set, Wget will try to load that file. Failing that, no further attempts will be made If ftp://user:password@host/path http://user:password@host/path61 is not set, Wget will try to load $HOME/. wgetrc The fact that user’s settings are loaded after the system-wide ones means that in case of collision user’s wgetrc overrides the system-wide wgetrc (in /usr/local/etc/wgetrc by default). Fascist admins, away 6. 2 Wgetrc SyntaxThe syntax of a wgetrc command is simple The variable will also be called command. Valid values are different for different commands The commands are case-, underscore- and minus-insensitive. Thus ‘DIr__PrefiX’, ‘DIr-PrefiX’ and ‘dirprefix’ are the same. Empty lines, lines beginning with ‘#’ and lines containing white-space only are discarded Commands that expect a comma-separated list will clear the list on an empty command. So, if you wish to reset the rejection list specified in global wgetrc, you can do it with 6. 3 Wgetrc CommandsBộ lệnh hoàn chỉnh được liệt kê bên dưới. Các giá trị pháp lý được liệt kê sau dấu '='. Các giá trị Boolean đơn giản có thể được đặt hoặc bỏ đặt bằng cách sử dụng 'bật' và 'tắt' hoặc '1' và '0' Một số lệnh lấy giá trị giả tùy ý. giá trị địa chỉ có thể là tên máy chủ hoặc địa chỉ IP chấm tứ giác. n có thể là bất kỳ số nguyên dương nào hoặc 'inf' cho vô cực, nếu thích hợp. giá trị chuỗi có thể là bất kỳ chuỗi không trống nào Hầu hết các lệnh này có tương đương dòng lệnh trực tiếp. Ngoài ra, bất kỳ lệnh wgetrc nào cũng có thể được chỉ định trên dòng lệnh bằng cách sử dụng khóa chuyển '--execute' (xem. ) chấp nhận/từ chối = chuỗiTương tự như ‘-A’/‘-R’ (xem ) add_hostdir = bật/tắtBật/tắt tên tệp có tiền tố máy chủ lưu trữ. '-nH' vô hiệu hóa nó ask_password = on/offPrompt for a password for each connection established. Cannot be specified when ‘--password’ is being used, because they are mutually exclusive. Equivalent to ‘--ask-password’ auth_no_challenge = bật/tắtIf this option is given, Wget will send Basic HTTP authentication information (plaintext username and password) for all requests. See ‘--auth-no-challenge’ background = on/offEnable/disable going to background—the same as ‘-b’ (which enables it) backup_converted = on/offEnable/disable saving pre-converted files with the suffix ‘. orig’—the same as ‘-K’ (which enables it) backups = numberUse up to number backups for a file. Backups are rotated by adding an incremental counter that starts at ‘1’. The default is ‘0’ base = stringConsider relative URLs in input files (specified via the ‘input’ command or the ‘--input-file’/‘-i’ option, together with ‘force_html’ or ‘--force-html’) as being relative to string—the same as ‘--base=string’ bind_address = addressBind to address, like the ‘--bind-address=address’ ca_certificate = fileSet the certificate authority bundle file to file. The same as ‘--ca-certificate=file’ ca_directory = directorySet the directory used for certificate authorities. The same as ‘--ca-directory=directory’ cache = on/offWhen set to off, disallow server-caching. See the ‘--no-cache’ option certificate = fileSet the client certificate file name to file. The same as ‘--certificate=file’ certificate_type = stringSpecify the type of the client certificate, legal values being ‘PEM’ (the default) and ‘DER’ (aka ASN1). The same as ‘--certificate-type=string’ check_certificate = on/offIf this is set to off, the server certificate is not checked against the specified client authorities. The default is “on”. The same as ‘--check-certificate’ connect_timeout = nSet the connect timeout—the same as ‘--connect-timeout’ content_disposition = on/offTurn on recognition of the (non-standard) ‘Content-Disposition’ HTTP header—if set to ‘on’, the same as ‘--content-disposition’ trust_server_names = on/offIf set to on, construct the local file name from redirection URLs rather than original URLs continue = on/offIf set to on, force continuation of preexistent partially retrieved files. See ‘-c’ before setting it convert_links = on/offConvert non-relative links locally. The same as ‘-k’ cookies = on/offWhen set to off, disallow cookies. See the ‘--cookies’ option cut_dirs = nIgnore n remote directory components. Equivalent to ‘--cut-dirs=n’ debug = on/offDebug mode, same as ‘-d’ default_page = stringDefault page name—the same as ‘--default-page=string’ delete_after = on/offDelete after download—the same as ‘--delete-after’ dir_prefix = stringĐầu cây thư mục—giống như '-P string' điều hướng = bật/tắtBật hoặc tắt dirstruct—tương ứng với '-x' hoặc '-nd' dns_cache = bật/tắtBật/tắt bộ nhớ đệm DNS. Since DNS caching is on by default, this option is normally used to turn it off and is equivalent to ‘--no-dns-cache’ dns_timeout = nĐặt thời gian chờ DNS—giống như ‘--dns-timeout’ domains = stringSame as ‘-D’ (see ) dot_bytes = nSpecify the number of bytes “contained” in a dot, as seen throughout the retrieval (1024 by default). You can postfix the value with ‘k’ or ‘m’, representing kilobytes and megabytes, respectively. With dot settings you can tailor the dot retrieval to suit your needs, or you can use the predefined styles (see ) dot_spacing = nSpecify the number of dots in a single cluster (10 by default) dots_in_line = nSpecify the number of dots that will be printed in each line throughout the retrieval (50 by default) egd_file = fileUse string as the EGD socket file name. The same as ‘--egd-file=file’ exclude_directories = stringSpecify a comma-separated list of directories you wish to exclude from download—the same as ‘-X string’ (see ) exclude_domains = stringSame as ‘--exclude-domains=string’ (see ) follow_ftp = on/offFollow FTP links from HTML documents—the same as ‘--follow-ftp’ follow_tags = stringOnly follow certain HTML tags when doing a recursive retrieval, just like ‘--follow-tags=string’ force_html = on/offIf set to on, force the input filename to be regarded as an HTML document—the same as ‘-F’ ftp_password = stringSet your FTP password to string. Without this setting, the password defaults to ‘-wget@’, which is a useful default for anonymous FTP access This command used to be named ftp://user:password@host/path http://user:password@host/path63 prior to Wget 1. 10ftp_proxy = string Use string as FTP proxy, instead of the one specified in environment ftp_user = stringSet FTP user to string This command used to be named ftp://user:password@host/path http://user:password@host/path64 prior to Wget 1. 10glob = on/off Turn globbing on/off—the same as ‘--glob’ and ‘--no-glob’ header = stringDefine a header for HTTP downloads, like using ‘--header=string’ compression = stringChoose the compression type to be used. Legal values are ‘auto’ (the default), ‘gzip’, and ‘none’. The same as ‘--compression=string’ adjust_extension = on/offAdd a ‘. html’ extension to ‘text/html’ or ‘application/xhtml+xml’ files that lack one, a ‘. css’ extension to ‘text/css’ files that lack one, and a ‘. br’, ‘. Z’, ‘. zlib’ or ‘. gz’ to compressed files like ‘-E’. Previously named ‘html_extension’ (still acceptable, but deprecated) http_keep_alive = on/offTurn the keep-alive feature on or off (defaults to on). Turning it off is equivalent to ‘--no-http-keep-alive’ http_password = stringSet HTTP password, equivalent to ‘--http-password=string’ http_proxy = stringUse string as HTTP proxy, instead of the one specified in environment http_user = stringĐặt người dùng HTTP thành chuỗi, tương đương với '--http-user=string' https_only = bật/tắtWhen in recursive mode, only HTTPS links are followed (defaults to off) https_proxy = chuỗiSử dụng chuỗi làm proxy HTTPS, thay vì chuỗi được chỉ định trong môi trường ignore_case = on/offKhi được đặt thành bật, khớp các tệp và thư mục một cách không nhạy cảm; ignore_length = on/offWhen set to on, ignore ftp://user:password@host/path http://user:password@host/path65 header; the same as ‘--ignore-length’ignore_tags = string Ignore certain HTML tags when doing a recursive retrieval, like ‘--ignore-tags=string’ include_directories = stringSpecify a comma-separated list of directories you wish to follow when downloading—the same as ‘-I string’ iri = on/offWhen set to on, enable internationalized URI (IRI) support; the same as ‘--iri’ inet4_only = on/offForce connecting to IPv4 addresses, off by default. You can put this in the global init file to disable Wget’s attempts to resolve and connect to IPv6 hosts. Available only if Wget was compiled with IPv6 support. The same as ‘--inet4-only’ or ‘-4’ inet6_only = on/offForce connecting to IPv6 addresses, off by default. Available only if Wget was compiled with IPv6 support. The same as ‘--inet6-only’ or ‘-6’ input = fileRead the URLs from string, like ‘-i file’ keep_session_cookies = on/offWhen specified, causes ‘save_cookies = on’ to also save session cookies. See ‘--keep-session-cookies’ limit_rate = rateLimit the download speed to no more than rate bytes per second. The same as ‘--limit-rate=rate’ load_cookies = fileLoad cookies from file. See ‘--load-cookies file’ local_encoding = encodingForce Wget to use encoding as the default system encoding. See ‘--local-encoding’ logfile = fileSet logfile to file, the same as ‘-o file’ max_redirect = numberSpecifies the maximum number of redirections to follow for a resource. See ‘--max-redirect=number’ mirror = on/offTurn mirroring on/off. The same as ‘-m’ netrc = on/offTurn reading netrc on or off no_clobber = on/offSame as ‘-nc’ no_parent = on/offDisallow retrieving outside the directory hierarchy, like ‘--no-parent’ (see ) no_proxy = stringUse string as the comma-separated list of domains to avoid in proxy loading, instead of the one specified in environment output_document = fileSet the output filename—the same as ‘-O file’ page_requisites = on/offDownload all ancillary documents necessary for a single HTML page to display properly—the same as ‘-p’ passive_ftp = on/offChange setting of passive FTP, equivalent to the ‘--passive-ftp’ option password = stringSpecify password string for both FTP and HTTP file retrieval. This command can be overridden using the ‘ftp_password’ and ‘http_password’ command for FTP and HTTP respectively post_data = stringUse POST as the method for all HTTP requests and send string in the request body. The same as ‘--post-data=string’ post_file = fileUse POST as the method for all HTTP requests and send the contents of file in the request body. The same as ‘--post-file=file’ prefer_family = none/IPv4/IPv6When given a choice of several addresses, connect to the addresses with specified address family first. The address order returned by DNS is used without change by default. The same as ‘--prefer-family’, which see for a detailed discussion of why this is useful private_key = fileSet the private key file to file. The same as ‘--private-key=file’ private_key_type = stringSpecify the type of the private key, legal values being ‘PEM’ (the default) and ‘DER’ (aka ASN1). The same as ‘--private-type=string’ progress = stringSet the type of the progress indicator. Legal types are ‘dot’ and ‘bar’. Equivalent to ‘--progress=string’ protocol_directories = on/offWhen set, use the protocol name as a directory component of local file names. The same as ‘--protocol-directories’ proxy_password = stringĐặt mật khẩu xác thực proxy thành chuỗi, như ‘--proxy-password=string’ proxy_user = stringSet proxy authentication user name to string, like ‘--proxy-user=string’ quiet = on/offChế độ im lặng—giống như '-q' quota = quotaSpecify the download quota, which is useful to put in the global wgetrc. When download quota is specified, Wget will stop retrieving after the download sum has become greater than quota. The quota can be specified in bytes (default), kbytes ‘k’ appended) or mbytes (‘m’ appended). Thus ‘quota = 5m’ will set the quota to 5 megabytes. Note that the user’s startup file overrides system settings Random_file = tập tinSử dụng tệp làm nguồn ngẫu nhiên trên các hệ thống thiếu /dev/random random_wait = on/offTurn random between-request wait times on or off. The same as ‘--random-wait’ read_timeout = nSet the read (and write) timeout—the same as ‘--read-timeout=n’ reclevel = nRecursion level (depth)—the same as ‘-l n’ recursive = on/offRecursive on/off—the same as ‘-r’ referer = stringSet HTTP ‘Referer. ’ header just like ‘--referer=string’. (Note that it was the folks who wrote the HTTP spec who got the spelling of “referrer” wrong. ) relative_only = on/offFollow only relative links—the same as ‘-L’ (see ) remote_encoding = encodingForce Wget to use encoding as the default remote server encoding. See ‘--remote-encoding’ remove_listing = on/offIf set to on, remove FTP listings downloaded by Wget. Setting it to off is the same as ‘--no-remove-listing’ restrict_file_names = unix/windowsRestrict the file names generated by Wget from URLs. See ‘--restrict-file-names’ for a more detailed description retr_symlinks = on/offWhen set to on, retrieve symbolic links as if they were plain files; the same as ‘--retr-symlinks’ retry_connrefused = on/offWhen set to on, consider “connection refused” a transient error—the same as ‘--retry-connrefused’ robots = on/offSpecify whether the norobots convention is respected by Wget, “on” by default. This switch controls both the /robots. txt and the ‘nofollow’ aspect of the spec. See , for more details about this. Be sure you know what you are doing before turning this off save_cookies = fileSave cookies to file. The same as ‘--save-cookies file’ save_headers = on/offSame as ‘--save-headers’ safe_protocol = chuỗiChoose the secure protocol to be used. Legal values are ‘auto’ (the default), ‘SSLv2’, ‘SSLv3’, and ‘TLSv1’. The same as ‘--secure-protocol=string’ server_response = on/offChoose whether or not to print the HTTP and FTP server responses—the same as ‘-S’ show_all_dns_entries = on/offWhen a DNS name is resolved, show all the IP addresses, not just the first three span_hosts = on/offSame as ‘-H’ spider = on/offSame as ‘--spider’ strict_comments = on/offSame as ‘--strict-comments’ timeout = nSet all applicable timeout values to n, the same as ‘-T n’ timestamping = on/offTurn timestamping on/off. The same as ‘-N’ (see ) use_server_timestamps = on/offIf set to ‘off’, Wget won’t set the local file’s timestamp by the one on the server (same as ‘--no-use-server-timestamps’) tries = nSet number of retries per URL—the same as ‘-t n’ use_proxy = on/offWhen set to off, don’t use proxy even when proxy-related environment variables are set. In that case it is the same as using ‘--no-proxy’ user = stringSpecify username string for both FTP and HTTP file retrieval. This command can be overridden using the ‘ftp_user’ and ‘http_user’ command for FTP and HTTP respectively user_agent = stringUser agent identification sent to the HTTP Server—the same as ‘--user-agent=string’ verbose = on/offTurn verbose on/off—the same as ‘-v’/‘-nv’ wait = nWait n seconds between retrievals—the same as ‘-w n’ wait_retry = nWait up to n seconds between retries of failed retrievals only—the same as ‘--waitretry=n’. Note that this is turned on by default in the global wgetrc 6. 4 Sample WgetrcThis is the sample initialization file, as given in the distribution. It is divided in two section—one for global usage (suitable for global startup file), and one for local usage (suitable for $HOME/. wgetrc). Be careful about the things you change Note that almost all the lines are commented out. For a command to have any effect, you must remove the ‘#’ character at the beginning of its line ftp://host/directory/file;type=a3 7 ExamplesThe examples are divided into three sections loosely based on their complexity 7. 1 Simple Usage
7. 2 Cách sử dụng nâng cao
7. 3 Cách sử dụng rất nâng cao
8 khác nhauChương này chứa tất cả những thứ không thể phù hợp với bất kỳ nơi nào khác 8. 1 proxyProxy là các máy chủ HTTP có mục đích đặc biệt được thiết kế để truyền dữ liệu từ máy chủ từ xa đến máy khách cục bộ. Một cách sử dụng điển hình của proxy là giảm tải mạng cho người dùng có kết nối chậm. Điều này đạt được bằng cách chuyển tất cả các yêu cầu HTTP và FTP thông qua proxy lưu trữ dữ liệu được truyền vào bộ đệm. Khi tài nguyên được lưu trong bộ đệm được yêu cầu lại, proxy sẽ trả về dữ liệu từ bộ đệm. Another use for proxies is for companies that separate (for security reasons) their internal networks from the rest of Internet. Để lấy thông tin từ Web, người dùng của họ kết nối và truy xuất dữ liệu từ xa bằng proxy được ủy quyền Wget hỗ trợ proxy cho cả truy xuất HTTP và FTP. Cách tiêu chuẩn để chỉ định vị trí proxy mà Wget nhận ra là sử dụng các biến môi trường sau ftp://user:password@host/path http://user:password@host/path67 ftp://user:password@host/path http://user:password@host/path68 Nếu được đặt, các biến ftp://user:password@host/path http://user:password@host/path67 và ftp://user:password@host/path http://user:password@host/path68 phải chứa URL của proxy cho các kết nối HTTP và HTTPS tương ứng ftp://user:password@host/path http://user:password@host/path71 Biến này phải chứa URL của proxy cho các kết nối FTP. Điều khá phổ biến là ftp://user:password@host/path http://user:password@host/path67 và ftp://user:password@host/path http://user:password@host/path71 được đặt thành cùng một URL ftp://user:password@host/path http://user:password@host/path74 Biến này phải chứa danh sách proxy phần mở rộng tên miền được phân tách bằng dấu phẩy và không được sử dụng cho. For instance, if the value of ftp://user:password@host/path http://user:password@host/path74 is ‘. mit. edu’, proxy sẽ không được sử dụng để truy xuất tài liệu từ MIT Ngoài các biến môi trường, vị trí và cài đặt proxy có thể được chỉ định từ bên trong chính Wget ‘--no-proxy’‘proxy = bật/tắt’Tùy chọn này và lệnh tương ứng có thể được sử dụng để chặn việc sử dụng proxy, ngay cả khi các biến môi trường thích hợp được đặt ‘http_proxy = URL’‘https_proxy = URL’‘ftp_proxy = URL’‘no_proxy = string’Các biến tệp khởi động này cho phép bạn ghi đè cài đặt proxy do môi trường chỉ định Một số máy chủ proxy yêu cầu ủy quyền để cho phép bạn sử dụng chúng. Ủy quyền bao gồm tên người dùng và mật khẩu, phải được gửi bởi Wget. Như với ủy quyền HTTP, tồn tại một số sơ đồ xác thực. Đối với ủy quyền proxy, sơ đồ xác thực ftp://user:password@host/path http://user:password@host/path76 hiện đang được triển khai Bạn có thể chỉ định tên người dùng và mật khẩu của mình thông qua URL proxy hoặc thông qua các tùy chọn dòng lệnh. Giả sử rằng proxy của công ty được đặt tại 'proxy. Công ty. com’ tại cổng 8001, vị trí URL proxy chứa dữ liệu ủy quyền có thể trông như thế này wget -X '' -X /~nobody,/~somebody5 Ngoài ra, bạn có thể sử dụng các tùy chọn 'người dùng proxy' và 'mật khẩu proxy' và tương đương. cài đặt wgetrc ftp://user:password@host/path http://user:password@host/path77 và ftp://user:password@host/path http://user:password@host/path78 để đặt tên người dùng và mật khẩu proxy 8. 2 DistributionGiống như tất cả các tiện ích GNU, phiên bản mới nhất của Wget có thể được tìm thấy tại trang lưu trữ GNU chính ftp. gnu. org, và gương của nó. Ví dụ, Wget 1. 21. 1-dirty có thể được tìm thấy tại https. // ftp. gnu. org/pub/gnu/wget/wget-1. 21. 1-bẩn. hắc ín. gz 8. 3 trang webTrang web chính thức của GNU Wget có tại https//www. gnu. tổ chức/phần mềm/wget/. Tuy nhiên, thông tin hữu ích nhất nằm ở “The Wget Wgiki”, http. //quên. addictivecode. tổ chức/ 8. 4 danh sách gửi thưDanh sách chínhDanh sách gửi thư chính để thảo luận, báo cáo lỗi hoặc đặt câu hỏi về GNU Wget có tại bug-wget@gnu. tổ chức. Để đăng ký, hãy gửi email đến bug-wget-join@gnu. org hoặc truy cập https. // danh sách. gnu. org/mailman/listinfo/bug-wget Bạn không cần đăng ký để gửi tin nhắn đến danh sách; . Nếu bạn muốn tin của mình hiện lên ngay lập tức, hãy đăng ký vào danh sách trước khi đăng. Lưu trữ cho danh sách có thể được tìm thấy tại https. // danh sách. gnu. org/archive/html/bug-wget/ Cổng NNTP/Usenettish cũng có sẵn qua Gmane. Bạn có thể xem kho lưu trữ Gmane tại http. //Tin tức. gmane. org/gmane. máy tính. trang web. quên đi. tổng quan. Lưu ý rằng kho lưu trữ Gmane thuận tiện bao gồm các tin nhắn từ cả danh sách hiện tại và danh sách trước đó. Tin nhắn cũng xuất hiện trong kho lưu trữ Gmane sớm hơn tại https. // danh sách. gnu. tổ chức Danh sách lỗi thờiTrước đây, danh sách gửi thư wget@sunsite. dk đã được sử dụng làm danh sách thảo luận chính và một danh sách khác, wget-patches@sunsite. dk đã được sử dụng để gửi và thảo luận về các bản vá cho GNU Wget Tin nhắn từ wget@sunsite. dk được lưu trữ tại Tin nhắn từ wget-patches@sunsite. dk được lưu trữ tại 8. 5 Internet Relay ChatIn addition to the mailinglists, we also have a support channel set up via IRC at ftp://user:password@host/path http://user:password@host/path79, ftp://user:password@host/path http://user:password@host/path80. Hãy đến kiểm tra xem nó ra 8. 6 Lỗi báo cáoBạn có thể gửi báo cáo lỗi thông qua trình theo dõi lỗi GNU Wget (xem https. // thảo nguyên. gnu. org/bugs/?func=additem&group=wget) hoặc vào danh sách gửi thư của chúng tôi bug-wget@gnu. tổ chức Truy cập https. // danh sách. gnu. org/mailman/listinfo/bug-wget để biết thêm thông tin (cách đăng ký, liệt kê tài liệu lưu trữ,. ) Trước khi thực sự gửi báo cáo lỗi, vui lòng thử làm theo một số nguyên tắc đơn giản
8. 7 Tính di độngLike all GNU software, Wget works on the GNU system. Tuy nhiên, vì nó sử dụng GNU Autoconf để xây dựng và định cấu hình, và hầu như tránh sử dụng các tính năng “đặc biệt” của bất kỳ Unix cụ thể nào, nên nó sẽ biên dịch (và hoạt động) trên tất cả các hương vị Unix phổ biến Các phiên bản Wget khác nhau đã được biên dịch và thử nghiệm dưới nhiều loại hệ thống Unix, bao gồm GNU/Linux, Solaris, SunOS 4. x, Mac OS X, OSF (còn gọi là Digital Unix hoặc Tru64), Ultrix, *BSD, IRIX, AIX, v.v. Một số hệ thống đó không còn được sử dụng rộng rãi và có thể không hỗ trợ các phiên bản Wget gần đây. Nếu Wget không thể biên dịch trên hệ thống của bạn, chúng tôi muốn biết về nó Nhờ những người đóng góp tốt bụng, phiên bản Wget này biên dịch và hoạt động trên nền tảng Microsoft Windows 32-bit. Nó đã được biên dịch thành công bằng MS Visual C++ 6. 0, Watcom, Borland C và trình biên dịch GCC. Đương nhiên, nó bị thiếu một số tính năng có sẵn trên Unix, nhưng nó sẽ hoạt động như một sự thay thế cho những người bị mắc kẹt với Windows. Lưu ý rằng các phần Wget dành riêng cho Windows không được đảm bảo sẽ được hỗ trợ trong tương lai, mặc dù điều này đã xảy ra trong thực tế trong nhiều năm nay. Tất cả các câu hỏi và vấn đề trong việc sử dụng Windows nên được báo cáo tới danh sách gửi thư của Wget tại wget@sunsite. dk nơi các tình nguyện viên duy trì các tính năng liên quan đến Windows có thể xem chúng Hỗ trợ xây dựng trên MS-DOS thông qua DJGPP đã được đóng góp bởi Gisle Vanem; . // antinode. thông tin/dec/sw/wget. html 8. 8 tín hiệuVì mục đích của Wget là hoạt động nền, nên nó bắt tín hiệu gác máy ( ftp://user:password@host/path http://user:password@host/path84) và bỏ qua nó. Nếu đầu ra là đầu ra tiêu chuẩn, nó sẽ được chuyển hướng đến một tệp có tên wget-log. Otherwise, ftp://user:password@host/path http://user:password@host/path84 is ignored. Điều này thuận tiện khi bạn muốn chuyển hướng đầu ra của Wget sau khi khởi động nó wget -X '' -X /~nobody,/~somebody6 Ngoài ra, Wget sẽ không can thiệp vào các tín hiệu theo bất kỳ cách nào. C-c, ftp://user:password@host/path http://user:password@host/path86 và ftp://user:password@host/path http://user:password@host/path87 nên giết nó như nhau 9 phụ lụcChương này chứa một số tài liệu tham khảo mà tôi cho là hữu ích 9. 1 Robot loại trừRất dễ làm cho Wget lang thang không mục đích quanh một trang web, hút tất cả dữ liệu có sẵn đang được xử lý. 'wget -r site' và bạn đã thiết lập. Tuyệt vời? Miễn là Wget chỉ truy xuất các trang tĩnh và thực hiện việc đó với tốc độ hợp lý (xem tùy chọn '--wait'), sẽ không có nhiều vấn đề. Vấn đề là Wget không thể phân biệt được sự khác biệt giữa trang tĩnh nhỏ nhất và CGI đòi hỏi khắt khe nhất. Một trang web mà tôi biết có một phần được xử lý bởi tập lệnh CGI Perl giúp chuyển đổi tệp Thông tin thành HTML một cách nhanh chóng. Tập lệnh chậm, nhưng hoạt động đủ tốt để người dùng xem tệp Thông tin không thường xuyên. Tuy nhiên, khi tải xuống Wget đệ quy của ai đó tình cờ gặp trang chỉ mục liên kết đến tất cả các tệp Thông tin thông qua tập lệnh, hệ thống sẽ bị dừng lại mà không cung cấp bất kỳ thứ gì hữu ích cho người dùng (Nhiệm vụ chuyển đổi tệp Thông tin này có thể được thực hiện cục bộ và truy cập Để tránh loại tai nạn này, cũng như để bảo vệ quyền riêng tư cho các tài liệu cần được bảo vệ khỏi rô-bốt hoạt động tốt, khái niệm loại trừ rô-bốt đã được phát minh. Ý tưởng là quản trị viên máy chủ và tác giả tài liệu có thể chỉ định phần nào của trang web mà họ muốn bảo vệ khỏi rô-bốt và phần nào họ sẽ cho phép truy cập The most popular mechanism, and the de facto standard supported by all the major robots, is the “Robots Exclusion Standard” (RES) written by Martijn Koster et al. năm 1994. Nó chỉ định định dạng của tệp văn bản chứa các lệnh hướng dẫn rô-bốt nên tránh các đường dẫn URL nào. Để được tìm thấy bởi robot, thông số kỹ thuật phải được đặt trong /robots. txt trong thư mục gốc của máy chủ mà các rô-bốt dự kiến sẽ tải xuống và phân tích cú pháp Mặc dù Wget không phải là rô bốt web theo nghĩa chặt chẽ nhất của từ này, nhưng nó có thể tải xuống phần lớn trang web mà không cần sự can thiệp của người dùng để tải xuống một trang riêng lẻ. Do đó, Wget vinh danh RES khi tải xuống đệ quy. Chẳng hạn, khi bạn phát hành wget -X '' -X /~nobody,/~somebody7 Đầu tiên, chỉ mục của 'www. thí dụ. com’ sẽ được tải xuống. Nếu Wget thấy rằng nó muốn tải thêm tài liệu từ máy chủ đó, nó sẽ yêu cầu ‘http. //www. thí dụ. com/robot. txt’ và nếu tìm thấy, hãy sử dụng nó để tải xuống thêm. người máy. txt chỉ được tải một lần trên mỗi máy chủ Until version 1. 8, Wget hỗ trợ phiên bản đầu tiên của tiêu chuẩn, được viết bởi Martijn Koster vào năm 1994 và có sẵn tại http. //www. robottxt. tổ chức/gốc. html. Kể từ phiên bản 1. 8, Wget đã hỗ trợ các chỉ thị bổ sung được chỉ định trong bản thảo internet ‘’ có tiêu đề “Phương pháp kiểm soát rô-bốt web”. Bản nháp, theo như tôi biết là chưa bao giờ được tạo cho RFC, có sẵn tại http. //www. robottxt. org/norobots-rfc. txt Sách hướng dẫn này không còn bao gồm văn bản của Tiêu chuẩn Loại trừ Robot Cơ chế thứ hai, ít được biết đến hơn, cho phép tác giả của một tài liệu riêng lẻ chỉ định xem họ có muốn rô-bốt theo dõi các liên kết từ tệp hay không. Điều này đạt được bằng cách sử dụng thẻ ftp://user:password@host/path http://user:password@host/path89, như thế này wget -X '' -X /~nobody,/~somebody8 Điều này được giải thích một số chi tiết tại http. //www. robottxt. org/meta. html. Wget hỗ trợ phương pháp loại trừ robot này ngoài /robots thông thường. loại trừ txt Nếu bạn biết mình đang làm gì và thực sự muốn tắt tính năng loại trừ rô-bốt, hãy đặt biến ftp://user:password@host/path http://user:password@host/path90 thành 'tắt' trong. wgetrc. Bạn có thể đạt được hiệu ứng tương tự từ dòng lệnh bằng cách sử dụng công tắc ftp://user:password@host/path http://user:password@host/path91, e. g. ‘wget -e robot=tắt url. ’ 9. 2 cân nhắc về bảo mậtKhi sử dụng Wget, bạn phải lưu ý rằng nó sẽ gửi mật khẩu không được mã hóa qua mạng, điều này có thể gây ra sự cố bảo mật. Dưới đây là những vấn đề chính và một số giải pháp
9. 3 cộng tác viênGNU Wget was written by Hrvoje Nikšić hniksic@xemacs. tổ chức, Tuy nhiên, sự phát triển của Wget không bao giờ có thể tiến xa như hiện tại nếu không có sự giúp đỡ của nhiều người, với các báo cáo lỗi, đề xuất tính năng, bản vá hoặc thư nói rằng “Cảm ơn. ” Xin gửi lời cảm ơn đặc biệt đến những người sau đây (không theo thứ tự cụ thể)
The following people have provided patches, bug/build reports, useful suggestions, beta testing services, fan mail and all the other things that make maintenance so much fun Tim Adam, Adrian Aichner, Martin Baehr, Dieter Baron, Roger Beeman, Dan Berger, T. Bharath, Christian Biere, Paul Bludov, Daniel Bodea, Mark Boyns, John Burden, Julien Buty, Wanderlei Cavassin, Gilles Cedoc, Tim Charron, Noel Cragg, Kristijan Čonkaš, John Daily, Andreas Damm, Ahmon Dancy, Andrew Davison, Bertrand Demiddelaer, Alexander Dergachev, Andrew Deryabin, Ulrich Drepper, Marc Duponcheel, Damir Džeko, Alan Eldridge, Hans-Andreas Engel, Aleksandar Erkalović, Andy Eskilsson, João Ferreira, Christian Fraenkel, David Fritz, Mike Frysinger, Charles C. Fu, FUJISHIMA Satsuki, Masashi Fujita, Howard Gayle, Marcel Gerrits, Lemble Gregory, Hans Grobler, Alain Guibert, Mathieu Guillaume, Aaron Hawley, Jochen Hein, Karl Heuer, Madhusudan Hosaagrahara, HIROSE Masaaki, Ulf Harnhammar, Gregor Hoffleit, Erik Magnus Hulthen, Richard Huveneers, Jonas Jensen, Larry Jones, Simon Josefsson, Mario Jurić, Hack Kampbjørn, Const Kaplinsky, Goran Kezunović, Igor Khristophorov, Robert Kleine, KOJIMA Haime, Fila Kolodny, Alexander Kourakos, Martin Kraemer, Sami Krank, Jay Krell, Σίμος Ξενιτέλλης (Simos KSenitellis), Christian Lackas, Hrvoje Lacko, Daniel S. Lewart, Nicolás Lichtmeier, Dave Love, Alexander V. Lukyanov, Thomas Lußnig, Andre Majorel, Aurelien Marchand, Matthew J. Mellon, Jordan Mendelson, Ted Mielczarek, Robert Millan, Lin Zhe Min, Jan Minar, Tim Mooney, Keith Moore, Adam D. Moss, Simon Munton, Charlie Negyesi, R. K. Owen, Jim Paris, Kenny Parnell, Leonid Petrov, Simone Piunno, Andrew Pollock, Steve Pothier, Jan Přikryl, Marin Purgar, Csaba Ráduly, Keith Refson, Bill Richardson, Tyler Riddle, Tobias Ringstrom, Jochen Roderburg, Juan José Rodríguez, Maciej W. Rozycki, Edward J. Sabol, Heinz Salzmann, Robert Schmidt, Nicolas Schodet, Benno Schulenberg, Andreas Schwab, Steven M. Schweda, Chris Seawood, Pranab Shenoy, Dennis Smit, Toomas Soome, Tage Stabell-Kulo, Philip Stadermann, Daniel Stenberg, Sven Sternberger, Markus Strasser, John Summerfield, Szakacsits Szabolcs, Mike Thomas, Philipp Thomas, Mauro Tortonesi, Dave Turner, Gisle . Wegscheid, Ralf Wildenhues, Joshua David Williams, Benjamin Wolsey, Saint Xavier, YAMAZAKI Makoto, Jasmin Zainul, Bojan Ždrnja, Kristijan Zimmer, Xin Zou Xin lỗi tất cả những người mà tôi đã vô tình bỏ qua và rất cảm ơn tất cả những người đăng ký danh sách gửi thư của Wget Phụ lục A Sao chép hướng dẫn nàyA. 1 Giấy phép Tài liệu Miễn phí GNUPhiên bản 1. 3, 3 tháng 11 năm 2008 wget -X '' -X /~nobody,/~somebody9
PHỤ LỤC. Cách sử dụng Giấy phép này cho tài liệu của bạnĐể sử dụng Giấy phép này trong tài liệu bạn đã viết, hãy đưa một bản sao của Giấy phép vào tài liệu và đặt thông báo bản quyền và giấy phép sau đây ngay sau trang tiêu đề wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z0 Nếu bạn có Phần bất biến, Văn bản bìa trước và Văn bản bìa sau, hãy thay thế “bằng…Văn bản. ” phù hợp với điều này wget -c ftp://sunsite.doc.ic.ac.uk/ls-lR.Z1 Nếu bạn có Phần bất biến không có Văn bản bìa hoặc một số kết hợp khác của cả ba, hãy hợp nhất hai lựa chọn thay thế đó cho phù hợp với tình huống Nếu tài liệu của bạn chứa các ví dụ không tầm thường về mã chương trình, chúng tôi khuyên bạn nên phát hành song song các ví dụ này theo lựa chọn giấy phép phần mềm tự do của bạn, chẳng hạn như Giấy phép Công cộng GNU, để cho phép sử dụng chúng trong phần mềm miễn phí |