Your message dated Sat, 25 Jun 2011 22:45:19 +0200
with message-id <1309034719.2148.4@xazone>
and subject line done
has caused the Debian Bug report #370297,
regarding cronosplit: Some minor things
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
370297: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=370297
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: cronolog
Version: 1.6.2-5
Severity: minor

In order to use BTS as my memo:

Some more things where I'd like to improve cronosplit:

* --utime option

This modifies the mtime of the created logfiles to the timestamp of the
last access line. Used to make the converted files look more authentic :-)

Patch attached.

* manpage --print-invalid

The --print-invalid option is not explained in the manpage.

* manpage: advanced usage

Give an example of usage for a huge set of logfiles. Basically you'd
not want to process the logfiles in globbed order but something like


    for TYPE in access error ; do
        for i in `seq 52 -1 1` '' ; do
            if [ "$i" ] ; then
                i=".$i"
            fi
            LOGFILE=/var/log/apache2/$TYPE.log$i

            if [ ! -f "$LOGFILE" ] ; then
                continue
            fi

            nice cronosplit --print-invalid \
                --template=TEMPLATE "$LOGFILE"
        done
    done


* manpage: BUGS section

cronosplit can now process error logfiles but only those that have a
date at the beginning of the line.


Oh, and by the way:
* manpage of cronolog

The example should refer to the actual location of cronolog i.e.

- TransferLog "|/www/sbin/cronolog /www/logs/%Y/%m/%d/access.log"
+ TransferLog "|/usr/bin/cronolog /www/logs/%Y/%m/%d/access.log" 

Same for ErrorLog.

    Christoph

-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.16.16
Locale: LANG=de_DE.UTF-8@euro, LC_CTYPE=de_DE.UTF-8@euro (charmap=UTF-8)

Versions of packages cronolog depends on:
ii  libc6                 2.3.2.ds1-22sarge3 GNU C Library: Shared libraries an
ii  perl [perl5]          5.8.4-8sarge4      Larry Wall's Practical Extraction 
--- cronosplit.LAST	2006-06-04 16:50:27.000000000 +0200
+++ cronosplit	2006-06-04 15:49:38.000000000 +0200
@@ -122,6 +122,7 @@
 my $template;
 my $debug;
 my $verbose;
+my $utime;
 my $PrintInvalids;
 my $print_help;
 my $print_version;
@@ -129,11 +130,13 @@
 
 my %OpenHandles = ();
 my @HandlesInUse = ();
+my %utimes = ();
 
 # Process options
 
 (GetOptions("template=s",	\$template,
 	    "print-invalid",	\$PrintInvalids,
+	    "utime",		\$utime,
 	    "debug",            \$debug,
 	    "verbose",          \$verbose,
 	    "help",             \$print_help,
@@ -176,6 +179,7 @@
 
   --template=TEMPLATE   output log-file template
   --print-invalid       print invalid log-file entries
+  --utime               update mtime of output files to last entry
   --help                print this help, then exit
   --version             print version number, then exit
 EOS
@@ -264,6 +268,17 @@
     close(INFILE);
 }
 
+# close any open files
+foreach my $oldkey (@HandlesInUse)
+{
+    $handle = $OpenHandles{$oldkey};
+     close $handle;
+    if ($utime)
+    {
+	my $mtime = $utimes{$oldkey};
+	utime $mtime, $mtime, $oldkey;
+    } 
+}
 
 # Get a file handle for a log file, closing the oldest handle if there
 # are too many handles open
@@ -279,6 +294,14 @@
     my(@time) = localtime($time_t);
     $file =~ s/(%[a-zA-Z%])/strftime($1, @time)/eg;
 
+    if ($utime)
+    {
+	if (!defined ($utimes{$file}) || $time_t > $utimes{$file})
+	{
+	    $utimes{$file} = $time_t;
+	}
+    }
+
     # See if we already have it open and ready to write
     
     return $handle if defined($handle = $OpenHandles{$file});
@@ -289,8 +312,13 @@
     {
         my ($oldkey) = shift @HandlesInUse;   # close the oldest
         $handle = $OpenHandles{$oldkey};
-        delete $OpenHandles{$oldkey};
         close $handle;
+	if ($utime)
+	{
+	    my $mtime = $utimes{$oldkey};
+	    utime $mtime, $mtime, $oldkey;
+	} 
+        delete $OpenHandles{$oldkey};
     }
 
     # Finally, try to open and remember a new handle for this pathkey

--- End Message ---
--- Begin Message ---

-- 
Maxime Chatelle, human from earth, 010001111 | cm94IGxvdmVyCg== 
<mchatelle ↯ linux-france ↯ org> <mmyc ↯ gmx ↯ com> gpl-kpr
gpg: 79E0 25F5 06C5 5C7F F57C BADD 13EE 911A 8A1A 9DE9

Attachment: pgpryPrnbqQRZ.pgp
Description: PGP signature


--- End Message ---

Reply via email to