savelog errors with custom extensions to archived log files

Bug #368697 reported by Steve Wilson
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
debianutils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: debianutils

apt-cache policy debianutils
debianutils:
  Installed: 2.29ubuntu2

Line 272 of savelog is not correct for log files with date extensions not containing exactly 14 digits. I suggest changing it from:
     $COMPRESS $COMPRESS_OPTS -- "$newname".[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
to something like:
    $COMPRESS $COMPRESS_OPTS -- $(ls "$newname".[0-9]* | grep -v $DOT_Z)

Also, the savelog man page has a couple of errors in it:
    1) The man page states that the -D format should be in the form of [MMDDhhmm[[CC]YY][.ss]]. I'm sure this isn't what was intended and is obviously just copied from the section on how to set the system date in the date man page. Instead, the -D format should use the same format as the date OUTPUT format (e.g., "%Y%m%d").
    2) The -d option MUST be specified when using the -D option. If only the -D option is given, it will be silently ignored and the default number version cycling will be used instead. This should either be clear in the man page or savelog modified to imply the -d option whenever the -D option is used.

Best regards,

Steve Wilson

ProblemType: Bug
Architecture: i386
Dependencies:
 libgcc1 1:4.3.2-1ubuntu12
 gcc-4.3-base 4.3.2-1ubuntu12
 findutils 4.4.0-2ubuntu3
 libc6 2.8~20080505-0ubuntu9
DistroRelease: Ubuntu 8.10
Package: debianutils 2.29ubuntu2 [modified: usr/bin/savelog]
ProcEnviron:
 PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: debianutils
Uname: Linux 2.6.27-11-generic i686

Tags: apport-bug
Revision history for this message
Andrew Glen-Young (aglenyoung) wrote :

> Line 272 of savelog is not correct for log files with date extensions not containing exactly 14 digits. I suggest changing it from:
> $COMPRESS $COMPRESS_OPTS -- "$newname".[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]
> to something like:
> $COMPRESS $COMPRESS_OPTS -- $(ls "$newname".[0-9]* | grep -v $DOT_Z)

To reproduce:

    $ mkdir logs
    $ echo foo > logs/foo.log
    $ savelog -q -d logs/foo.log
    gzip: logs//foo.log.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]: No such file or directory

Subsequent runs do not seem to show this error message:

    $ echo bar > logs/foo.log
    $ savelog -q -d logs/foo.log

Revision history for this message
Maarten Bezemer (veger) wrote :

I can confirm the behavior described at comment #2

Changed in debianutils (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.