From owner-freebsd-questions@FreeBSD.ORG Fri Jul 17 22:12:33 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C7891065672 for ; Fri, 17 Jul 2009 22:12:33 +0000 (UTC) (envelope-from jjah@cloud.ccsf.cc.ca.us) Received: from cloud.ccsf.cc.ca.us (cloud.ccsf.cc.ca.us [147.144.1.212]) by mx1.freebsd.org (Postfix) with ESMTP id 188018FC16 for ; Fri, 17 Jul 2009 22:12:32 +0000 (UTC) (envelope-from jjah@cloud.ccsf.cc.ca.us) Received: from cloud.ccsf.cc.ca.us (localhost.ccsf.cc.ca.us [127.0.0.1]) by cloud.ccsf.cc.ca.us (8.14.2/8.14.2) with ESMTP id n6HMCX3i039075 for ; Fri, 17 Jul 2009 15:12:33 -0700 (PDT) (envelope-from jjah@cloud.ccsf.cc.ca.us) Received: from localhost (jjah@localhost) by cloud.ccsf.cc.ca.us (8.14.2/8.14.2/Submit) with ESMTP id n6HMCXHb039072 for ; Fri, 17 Jul 2009 15:12:33 -0700 (PDT) (envelope-from jjah@cloud.ccsf.cc.ca.us) Date: Fri, 17 Jul 2009 15:12:33 -0700 (PDT) From: "Joe R. Jah" To: freebsd-questions@freebsd.org Message-ID: <20090717144049.C35992@cloud.ccsf.cc.ca.us> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: OT: wget bug X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jul 2009 22:12:33 -0000 Hello all, I want to wget a site at regular intervals and only get the updated pages, so I use the this wget command line: wget -b -m -nH http://host.domain/Directory/file.html It works fine on the first try, but it fails on subsequent tries with the following error message: --8<-- Connecting to host.domain ... connected. HTTP request sent, awaiting response... 401 Unauthorized Authorization failed. --8<-- I can change directory from which to run wget every time, but that defeats the purpose of downloading only the changed files. I googled "wget fails on second try" and found this small patch in a Linux group that should supposedly fix the problem: --8<-- --- wget-1.10.2/src/ftp.c.cwd 2006-12-03 13:23:08.801467652 +0100 +++ wget-1.10.2/src/ftp.c 2006-12-03 20:30:24.641876672 +0100 @@ -1172,7 +1172,7 @@ len = 0; err = getftp (u, &len, restval, con); - if (con->csock != -1) + if (con->csock == -1) con->st &= ~DONE_CWD; else con->st |= DONE_CWD; --8<-- My wget is the latest version in the ports, 1.11.4. Any ideas or advise is greatly appreciated. Regards, Joe -- _/ _/_/_/ _/ ____________ __o _/ _/ _/ _/ ______________ _-\<,_ _/ _/ _/_/_/ _/ _/ ......(_)/ (_) _/_/ oe _/ _/. _/_/ ah jjah@cloud.ccsf.cc.ca.us