Репозитории 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-config.patch
Скачать
Скачать
--- logrotate/config.h
+++ logrotate/config.h
@@ -31,17 +31,17 @@
#endif
#ifndef COMPRESS_COMMAND
-#define COMPRESS_COMMAND "/bin/gzip"
+#define COMPRESS_COMMAND "/usr/bin/xz"
#endif
#ifndef COMPRESS_EXT
-#define COMPRESS_EXT ".gz"
+#define COMPRESS_EXT ".xz"
#endif
#ifndef UNCOMPRESS_COMMAND
-#define UNCOMPRESS_COMMAND "/bin/gunzip"
+#define UNCOMPRESS_COMMAND "/usr/bin/unxz"
#endif
#ifndef STATEFILE
-#define STATEFILE "/var/lib/logrotate.status"
+#define STATEFILE "/var/lib/logrotate/status"
#endif
--- logrotate/examples/logrotate-default
+++ logrotate/examples/logrotate-default
@@ -8,11 +8,17 @@ rotate 4
# create new (empty) log files after rotating old ones
create
-# use date as a suffix of the rotated file
-dateext
+# comment this out if you want your log files remain uncompressed
+compress
-# uncomment this if you want your log files compressed
-#compress
+# do not rotate empty log files
+notifempty
+
+# uncomment this if you want to use date as a suffix for rotated files
+#dateext
+
+# logs are moved into this directory for rotation
+#olddir old
# RPM packages drop log rotation information into this directory
include /etc/logrotate.d
@@ -22,14 +28,12 @@ include /etc/logrotate.d
monthly
create 0664 root utmp
minsize 1M
- rotate 1
}
/var/log/btmp {
missingok
monthly
create 0600 root utmp
- rotate 1
}
# system-specific logs may be also be configured here.
--- logrotate/logrotate.8
+++ logrotate/logrotate.8
@@ -65,7 +65,7 @@ and mail it to the recipient. The default mail command is \fB/bin/mail
\fB\-s\fR, \fB\-\-state <statefile>\fR
Tells \fBlogrotate\fR to use an alternate state file. This is useful
if logrotate is being run as a different user for various sets of
-log files. The default state file is \fI/var/lib/logrotate.status\fR.
+log files. The default state file is \fI/var/lib/logrotate/status\fR.
.TP
\fB\-\-usage\fR
@@ -163,18 +163,18 @@ a \fBlogrotate\fR configuration file:
.TP
\fBcompress\fR
-Old versions of log files are compressed with \fBgzip\fR(1) by default. See also
+Old versions of log files are compressed with \fBxz\fR(1) by default. See also
\fBnocompress\fR.
.TP
\fBcompresscmd\fR
Specifies which command to use to compress log files. The default is
-\fBgzip\fR(1). See also \fBcompress\fR.
+\fBxz\fR(1). See also \fBcompress\fR.
.TP
\fBuncompresscmd\fR
Specifies which command to use to uncompress log files. The default is
-\fBgunzip\fR(1).
+\fBunxz\fR(1).
.TP
\fBcompressext\fR
@@ -185,7 +185,7 @@ command.
.TP
\fBcompressoptions\fR
Command line options may be passed to the compression program, if one is
-in use. The default, for \fBgzip\fR(1), is "\-6" (biased towards high
+in use. The default, for \fBxz\fR(1), is "\-6" (biased towards high
compression at the expense of speed).
If you use a different compression command, you may need to change the
\fBcompressoptions\fR to match.
@@ -272,9 +272,9 @@ and thus might continue writing to the previous log file for some time.
.TP
\fBextension \fIext\fR
Log files with \fIext\fR extension can keep it after the rotation.
-If compression is used, the compression extension (normally \fI.gz\fR)
+If compression is used, the compression extension (normally \fI.xz\fR)
appears after \fIext\fR. For example you have a logfile named mylog.foo
-and want to rotate it to mylog.1.foo.gz instead of mylog.foo.1.gz.
+and want to rotate it to mylog.1.foo.xz instead of mylog.foo.1.xz.
.TP
\fBhourly\fR
@@ -557,14 +557,14 @@ Log files are rotated if the current year is not the same as the last rotation.
.SH FILES
.PD 0
.TP 27
-\fI/var/lib/logrotate.status\fR
+\fI/var/lib/logrotate/status\fR
Default state file.
.TP 27
\fI/etc/logrotate.conf\fR
Configuration options.
.SH SEE ALSO
-.BR gzip (1)
+.BR xz (1)
<http://fedorahosted.org/logrotate/>
--- logrotate/test/compress
+++ logrotate/test/compress
@@ -1,4 +1,4 @@
#!/bin/bash
-echo "gzip $*" > compress-args
-gzip $*
\ No newline at end of file
+echo "xz $*" > compress-args
+xz $*
\ No newline at end of file
--- logrotate/test/compress-error
+++ logrotate/test/compress-error
@@ -1,4 +1,4 @@
#!/bin/bash
echo "compression error" 1>&2
-gzip $*
\ No newline at end of file
+xz $*
\ No newline at end of file
--- logrotate/test/test
+++ logrotate/test/test
@@ -119,7 +119,7 @@ createlog() {
esac
echo $what > $file
- [ -n "$cl_compressed" ] && gzip -9 $file
+ [ -n "$cl_compressed" ] && xz $file
}
createlogs() {
@@ -165,7 +165,7 @@ checkoutput() {
fi
if [ -n "$co_compressed" -a "$co_compressed" != 0 ]; then
- contents=`gunzip -c $file`
+ contents=`unxz -c $file`
else
contents=`cat $file`
fi
@@ -364,7 +364,7 @@ $RLR test-config.8 --force
checkoutput <<EOF
test.log 0
-test.log.1.gz 1 zero
+test.log.1.xz 1 zero
scriptout 0 foo
EOF
@@ -406,10 +406,10 @@ echo "newfile" > test.log
$RLR test-config.10 --force
if [ $SELINUX_TESTS == 1 ]; then
- ls -Z test.log.2.gz|grep logrotate_tmp_t >/dev/null
+ ls -Z test.log.2.xz|grep logrotate_tmp_t >/dev/null
if [ $? != 0 ]; then
- echo "test.log.2.gz should have selinux context logrotate_tmp_t."
- ls -Z test.log.2.gz
+ echo "test.log.2.xz should have selinux context logrotate_tmp_t."
+ ls -Z test.log.2.xz
exit 3
fi
@@ -424,7 +424,7 @@ fi
checkoutput <<EOF
test.log 0
test.log.1 0 newfile
-test.log.2.gz 1 zero
+test.log.2.xz 1 zero
EOF
checkmail test.log.1 newfile
@@ -569,10 +569,10 @@ $RLR test-config.18 --force
checkoutput <<EOF
test.log 0
-test.log.1.gz 1 zero
+test.log.1.xz 1 zero
EOF
-(echo "gzip -f -9") | diff -u - compress-args
+(echo "xz -f -9") | diff -u - compress-args
cleanup 19
@@ -1412,13 +1412,13 @@ DATE=""
for i in {1..60}
do
DATE=$(/bin/date "+%s" --date "$i hour ago" 2>/dev/null)
- echo "x" > test.log-$DATE.gz
+ echo "x" > test.log-$DATE.xz
done
$RLR test-config.55 --force
-if [ -e test.log-$DATE.gz ]; then
- echo "File test.log-$DATE.gz should not exist (it should be deleted)"
+if [ -e test.log-$DATE.xz ]; then
+ echo "File test.log-$DATE.xz should not exist (it should be deleted)"
exit 3
fi
@@ -1471,7 +1471,7 @@ rm -f error.log
checkoutput <<EOF
test.log 0
-test.log.1.gz 1 zero
+test.log.1.xz 1 zero
EOF
cleanup 58