Репозитории ALT
S: | 3.20.1-alt2 |
5.1: | 3.7.9-alt0.M51.1 |
4.1: | 3.6.2-alt4 |
4.0: | 3.6.2-alt4 |
3.0: | 3.6.2-alt3 |
Группа :: Работа с файлами
Пакет: logrotate
Главная Изменения Спек Патчи Sources Загрузить Gear Bugs and FR Repocop
Патч: logrotate-alt-taboo.patch
Скачать
Скачать
--- logrotate/config.c
+++ logrotate/config.c
@@ -113,7 +113,8 @@ enum {
static char *defTabooExts[] = { ".rpmsave", ".rpmorig", "~", ",v",
".disabled", ".dpkg-old", ".dpkg-dist", ".dpkg-new", ".cfsaved",
".ucf-old", ".ucf-dist", ".ucf-new",
- ".rpmnew", ".swp", ".cfsaved", ".rhn-cfg-tmp-*"
+ ".rpmnew", ".swp", ".cfsaved", ".rhn-cfg-tmp-*",
+ ".gz", ".bz2", ".xz", ".[0-9]", ".[0-9][0-9]", ".[0-9][0-9][0-9]"
};
static int defTabooCount = sizeof(defTabooExts) / sizeof(char *);
@@ -1420,6 +1420,8 @@ static int readConfigFile(const char *configFile, struct logInfo *defConfig)
}
}
}
+ if (!checkFile(globResult.gl_pathv[i]))
+ continue;
newlog->files[newlog->numFiles] =
strdup(globResult.gl_pathv[i]);
--- logrotate/logrotate.8
+++ logrotate/logrotate.8
@@ -540,7 +540,29 @@ The current taboo extension list is changed (see the \fBinclude\fR directive
for information on the taboo extensions). If a + precedes the list of
extensions, the current taboo extension list is augmented, otherwise it
is replaced. At startup, the taboo extension list
-contains .rpmsave, .rpmorig, ~, .disabled, .dpkg\-old, .dpkg\-dist, .dpkg\-new, .cfsaved, .ucf\-old, .ucf\-dist, .ucf\-new, .rpmnew, .swp, .cfsaved, .rhn\-cfg\-tmp\-*
+contains
+.IR ~ ,
+.IR .bz2 ,
+.IR .cfsaved ,
+.IR .cfsaved ,
+.IR .disabled ,
+.IR .dpkg\-dist ,
+.IR .dpkg\-new ,
+.IR .dpkg\-old ,
+.IR .gz ,
+.IR .rhn\-cfg\-tmp\-* ,
+.IR .rpmnew ,
+.IR .rpmorig ,
+.IR .rpmsave ,
+.IR .swp ,
+.IR .ucf\-dist ,
+.IR .ucf\-new ,
+.IR .ucf\-old ,
+.IR .xz ,
+.IR .[0-9] ,
+.IR .[0-9][0-9] ,
+and
+.IR .[0-9][0-9][0-9] .
.TP
\fBweekly\fR
--- logrotate/test/test
+++ logrotate/test/test
@@ -429,6 +429,54 @@ EOF
checkmail test.log.1 newfile
+cleanup 991
+
+# ------------------------------- Test 991 ------------------------------------
+mkdir subdir
+preptest subdir/sample.log 991 8
+$RLR test-config.991 --force
+
+checkoutput <<EOF
+subdir/sample.log 0
+subdir/sample.log.1 0 zero
+subdir/sample.log.2 0 first
+subdir/sample.log.3 0 second
+subdir/sample.log.4 0 third
+subdir/sample.log.5 0 fourth
+subdir/sample.log.6 0 fifth
+subdir/sample.log.7 0 sixth
+subdir/sample.log.8 0 seventh
+EOF
+
+checkmail subdir/sample.log.1 zero
+
+rm -rf subdir
+cleanup 992
+
+# ------------------------------- Test 992 ------------------------------------
+mkdir subdir
+preptest subdir/sample.log 992 2 0
+$RLR test-config.992 --force
+
+checkoutput <<EOF
+subdir/sample.log 0
+subdir/sample.log.1 0 zero
+subdir/sample.log.2.xz 1 first
+EOF
+
+echo "newfile" > subdir/sample.log
+$RLR test-config.992 --force
+
+checkoutput <<EOF
+subdir/sample.log 0
+subdir/sample.log.1 0 newfile
+subdir/sample.log.2.xz 1 zero
+subdir/sample.log.3.xz 1 first
+EOF
+
+checkmail subdir/sample.log.1 newfile
+
+rm -rf subdir
cleanup 11
# ------------------------------- Test 11 ------------------------------------
--- /dev/null
+++ logrotate/test/test-config.991.in
@@ -0,0 +1,9 @@
+create
+
+&DIR&/subdir/* {
+ daily
+ rotate 8
+ nocompress
+ mailfirst
+ mail user@myhost.org
+}
--- /dev/null
+++ logrotate/test/test-config.992.in
@@ -0,0 +1,10 @@
+create
+
+&DIR&/subdir/* {
+ daily
+ rotate 3
+ compress
+ delaycompress
+ mailfirst
+ mail user@myhost.org
+}