From 92c4b7a6d66cd0100767656b6c789d89bef0e31c Mon Sep 17 00:00:00 2001 From: Bruce Dubbs Date: Fri, 4 Jul 2014 20:14:17 +0000 Subject: [PATCH] Add logrotate-3.8.7 git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@13344 af4574ff-66df-0310-9fd7-8a98e5e911e0 --- general.ent | 5 +- general/sysutils/logrotate.xml | 249 +++++++++++++++++++++++++++++ general/sysutils/sysutils.xml | 1 + introduction/welcome/changelog.xml | 10 ++ 4 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 general/sysutils/logrotate.xml diff --git a/general.ent b/general.ent index f21b3fd865..6c76f17250 100644 --- a/general.ent +++ b/general.ent @@ -1,12 +1,12 @@ - + - + @@ -348,6 +348,7 @@ export -f as_root + diff --git a/general/sysutils/logrotate.xml b/general/sysutils/logrotate.xml new file mode 100644 index 0000000000..0d7d9c7b31 --- /dev/null +++ b/general/sysutils/logrotate.xml @@ -0,0 +1,249 @@ + + + %general-entities; + + + + + + + +]> + + + + + + $LastChangedBy: bdubbs $ + $Date: 2014-06-15 13:40:02 -0500 (Sun, 15 Jun 2014) $ + + + Logrotate-&logrotate-version; + + + logrotate + + + + Introduction to Logrotate + + + The logrotate package allows automatic rotation, + compression, removal, and mailing of log files. + + + &lfs75_checked; + + Package Information + + + + Download (HTTP): + + + + + Download (FTP): + + + + + Download MD5 sum: &logrotate-md5sum; + + + + + Download size: &logrotate-size; + + + + + Estimated disk space required: &logrotate-buildsize; + + + + + Estimated build time: &logrotate-time; + + + + + Logrotate Dependencies + + Required + + + + + Recommended + + (runtime) + + + Optional + + An (runtime) + + + User Notes: + + + + + + Installation of Logrotate + + + Install logrotate by running the following + command: + + +make + + + To test the results, issue: make test. + + + + Now, as the root user: + + +make MANDIR=/usr/share/man install + + + + + Command Explanations + + + MANDIR=/usr/share/man: Ensure the man pages are installed in + the correct location. + + + + + + Configuring Logrotate + + Logrotate needs a configuration file, + which must be passed as an argument to the command when executed. Create + the file as the root user: + +cat > /etc/logrotate.conf << EOF +# Begin of /etc/logrotate.conf + +# Rotate log files weekly +weekly + +# Don't send mail to anybody +nomail + +# If the log file is empty, it will not be rotated +notifempty + +# Number of backups that will be kept +# This will keep the 2 newest backups only +rotate 2 + +# Create new empty files after rotating old ones +# This will create empty log files, with owner +# set to root, group set to sys, and permissions 644 +create 0664 root sys + +# Compress the backups with gzip +compress + +# No packages own lastlog or wtmp -- rotate them here +/var/log/wtmp { + monthly + create 0664 root utmp + rotate 1 +} + +/var/log/lastlog { + monthly + rotate 1 +} + +# Some packages drop log rotation info in this directory +# so we include any file in it. +include /etc/logrotate.d + +# End of /etc/logrotate.conf +EOF + + Now create the /etc/logrotate.d + directory as the root user: + + mkdir -p /etc/logrotate.d + + At this point additional log rotation commands can be entered, typically + in the /etc/logrotate.d directory. + For example: + +cat > /etc/logrotate.d/sys.log << EOF +sys.log { + # If the log file is larger than 100kb, rotate it + size 100k + rotate 5 + weekly + postrotate + /bin/killall -HUP syslogd + endscript +} +EOF + + See the logrotate man page or + + for more examples. + + The command logrotate /etc/logrotate.conf can be + run manually, however, the command should be run daily. + To set up to run at 3AM daily, root's crontab + should be edited to add: + +0 3 * * * /usr/sbin/logrotate /etc/logrotate.conf + + + + + + Contents + + + Installed Programs + Installed Library + Installed Directories + + + logrotate + None + None + + + + + Short Descriptions + + + + + logrotate + + + performs the log maintenace functions defined in the + configuration files. + + + logrotate + + + + + + + + + diff --git a/general/sysutils/sysutils.xml b/general/sysutils/sysutils.xml index 3045afad35..4554f26948 100644 --- a/general/sysutils/sysutils.xml +++ b/general/sysutils/sysutils.xml @@ -31,6 +31,7 @@ $Date$ + diff --git a/introduction/welcome/changelog.xml b/introduction/welcome/changelog.xml index 3041715294..58677e3ac6 100644 --- a/introduction/welcome/changelog.xml +++ b/introduction/welcome/changelog.xml @@ -44,6 +44,16 @@ --> + + July 4th, 2014 + + + [bdubbs] - Add logrotate-3.8.7. Fixes + #5229. + + + + July 3rd, 2014