savelog errors with custom extensions to archived log files
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"
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[
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-
DistroRelease: Ubuntu 8.10
Package: debianutils 2.29ubuntu2 [modified: usr/bin/savelog]
ProcEnviron:
PATH=/
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: debianutils
Uname: Linux 2.6.27-11-generic i686
> Line 272 of savelog is not correct for log files with date extensions not containing exactly 14 digits. I suggest changing it from: .[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]
> $COMPRESS $COMPRESS_OPTS -- "$newname"
> to something like:
> $COMPRESS $COMPRESS_OPTS -- $(ls "$newname".[0-9]* | grep -v $DOT_Z)
To reproduce:
$ mkdir logs 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
$ echo foo > logs/foo.log
$ savelog -q -d logs/foo.log
gzip: logs//foo.
Subsequent runs do not seem to show this error message:
$ echo bar > logs/foo.log
$ savelog -q -d logs/foo.log