bugGNU Wget - Bugs: bug #33823, 'wget -c -N' ignores timestamps

 
 

bug #33823: 'wget -c -N' ignores timestamps

Submitter:  Noël Köthe <nok>
Submitted:  Sat 23 Jul 2011 08:30:17 AM UTC
   
 
Category:  Program Logic Severity:  3 - Normal
Priority:  5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  gscrivano
Originator Name:  Open/Closed:  Closed
Release:  1.12 Operating System:  GNU/Linux
Reproducibility:  Every Time Fixed Release:  None
Planned Release:  None Regression:  Yes
Work Required:  None Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 05 Aug 2011 08:05:16 PM UTC, comment #1: 

fixed in the development version.

Giuseppe Scrivano <gscrivano>
Group administrator
Sat 23 Jul 2011 08:30:17 AM UTC, original submission:  

Hello,

http://bugs.debian.org/402001

--8<--
in my script /usr/share/mplayer/scripts/binary_codecs.sh
I would like to use 'wget' to keep some files up-to-date

Consider those commands

$ cd /tmp
$ MYSITE='http://people.debian.org/~mennucc1/mplayer'
$ touch -d '1 Dec 1970' mirrors
$ ls -l mirrors
-rw-r--r-- 1 debdev debian 0 1970-12-01 00:00 mirrors
$ wget -v -c -N $MYSITE/mirrors
--12:13:59--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]
Remote file is newer, retrieving.
--12:14:00--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Reusing existing connection to people.debian.org:80.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]

100%[====================================================>] 336           --.--K/s

12:14:00 (35.60 MB/s) - `mirrors' saved [336/336]
^^^^^^^^^^^^


So far all is fine. But now look at this:
$  touch -d '1 Dec 1970' mirrors
$ ls -l mirrors
-rw-r--r-- 1 debdev debian 336 Dec  1  1970 mirrors
$ wget -v -c -N $MYSITE/mirrors
--12:15:16--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 416 Requested Range Not Satisfiable

    The file is already fully retrieved; nothing to do.
^^^^^^^^^^^

Argh! 'wget' checks the size but not the timestamp!

Instead I checked that '-N' alone works:
$ wget -v  -N   $MYSITE/mirrors
--12:16:24--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]
Remote file is newer, retrieving.
--12:16:25--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Reusing existing connection to people.debian.org:80.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]

100%[====================================================>] 336           --.--K/s

12:16:25 (32.04 MB/s) - `mirrors' saved [336/336]
^^^^^^^^^^^^^^

and trying again

$ wget -v  -N   $MYSITE/mirrors
--12:16:29--  http://people.debian.org/~mennucc1/mplayer/mirrors
           => `mirrors'
Resolving people.debian.org... 192.25.206.10
Connecting to people.debian.org|192.25.206.10|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 336 [text/plain]
Server file no newer than local file `mirrors' -- not retrieving.
^^^^^^^^^^^^
--8<--

and another comment from the bug (wget 1.12)

--8<--
I've run into a similar problem. I want to mirror a site where not
everything has timestamps. If I select -N then all files without
timestamps will be downloaded again and again. If I select -c then
files with timestamps that have changed will be continued leading to
broken files.

I would like to tell wget to use -c as fallback to -N.
--8<--

Noël Köthe <nok>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gscrivano (Posted a comment)
  • -email is unavailable- added by nok (Submitted the item)
  • -email is unavailable- added by nok (Debian BTS)
  •  

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-08-06 gscrivano Open/ClosedOpen Closed
    2011-08-05 gscrivano StatusNone Fixed
        Assigned toNone gscrivano
    2011-07-23 nok Carbon-Copy- Added -email is unavailable-

    Back to the top

    Powered by Savane 3.13-14b3.
    Corresponding source code