FreeBSD Bugzilla – Attachment 80539 Details for
Bug 115486
[patch] [request] newsyslog(8) -- provide ability to compress Nth rotated file
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.58 KB, created by
david
on 2007-08-14 00:30:01 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
david
Created:
2007-08-14 00:30:01 UTC
Size:
2.58 KB
patch
obsolete
>Index: newsyslog.c >=================================================================== >RCS file: /cvs/freebsd/src/usr.sbin/newsyslog/newsyslog.c,v >retrieving revision 1.107 >diff -u -r1.107 newsyslog.c >--- newsyslog.c 17 Aug 2006 18:15:43 -0000 1.107 >+++ newsyslog.c 12 Aug 2007 17:26:08 -0000 >@@ -127,6 +127,8 @@ > struct ptime_data *trim_at; /* Specific time to do trimming */ > unsigned int permissions; /* File permissions on the log */ > int flags; /* CE_COMPACT, CE_BZCOMPACT, CE_BINARY */ >+ int nuncompact; /* number of rotations that should not >+ * be compressed; -1 turns this off */ > int sig; /* Signal to send */ > int def_cfg; /* Using the <default> rule for this file */ > struct conf_entry *next;/* Linked list pointer */ >@@ -1187,6 +1189,11 @@ > } > > for (; q && *q && !isspacech(*q); q++) { >+ if (isdigit(*q)) { >+ working->nuncompact = strtol(q, NULL, 10); >+ while(isdigit(*(q+1))) q++; >+ continue; >+ } > switch (tolowerch(*q)) { > case 'b': > working->flags |= CE_BINARY; >@@ -1456,6 +1463,12 @@ > (void)rename(zfile1, zfile2); > } > change_attrs(zfile2, ent); >+ if ((flags & (CE_COMPACT | CE_BZCOMPACT)) && >+ (ent->nuncompact != -1) && >+ (numlogs_c == ent->nuncompact)) { >+ free_or_keep = KEEP_ENT; >+ save_zipwork(ent, NULL, ent->fsize, file2); >+ } > } > > if (ent->numlogs > 0) { >@@ -1494,7 +1507,8 @@ > swork = NULL; > if (ent->pid_file != NULL) > swork = save_sigwork(ent); >- if (ent->numlogs > 0 && (flags & (CE_COMPACT | CE_BZCOMPACT))) { >+ if (ent->numlogs > 0 && (flags & (CE_COMPACT | CE_BZCOMPACT)) >+ && ent->nuncompact == -1) { > /* > * The zipwork_entry will include a pointer to this > * conf_entry, so the conf_entry should not be freed. >Index: newsyslog.conf.5 >=================================================================== >RCS file: /cvs/freebsd/src/usr.sbin/newsyslog/newsyslog.conf.5,v >retrieving revision 1.6 >diff -u -r1.6 newsyslog.conf.5 >--- newsyslog.conf.5 29 Sep 2006 17:57:03 -0000 1.6 >+++ newsyslog.conf.5 13 Aug 2007 18:08:03 -0000 >@@ -242,6 +242,16 @@ > files matched by this line. > The following are valid flags: > .Bl -tag -width indent >+.It Ar number >+In combination with one of the compression flags >+.Cm J >+or >+.Cm Z >+, this selects which one of the already-rotated archives will be >+subject to the requested compression. If it is omitted and compression >+is specified, the most recently-rotated archive file will be compressed. >+(Compression is done subsequent to rotation, but the selection >+specified here is done prior to the rotation.) > .It Cm B > indicates that the log file is a binary file, or has some > special format.
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 115486
: 80539 |
181029