mirror of
https://github.com/Zeckmathederg/glfs.git
synced 2025-02-03 06:27:16 +08:00
Add logrotate-3.8.7
git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@13344 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
parent
5de07bef63
commit
92c4b7a6d6
@ -1,12 +1,12 @@
|
||||
<!-- $LastChangedBy$ $Date$ -->
|
||||
|
||||
<!ENTITY day "03"> <!-- Always 2 digits -->
|
||||
<!ENTITY day "04"> <!-- Always 2 digits -->
|
||||
<!ENTITY month "07"> <!-- Always 2 digits -->
|
||||
<!ENTITY year "2014">
|
||||
<!ENTITY copyrightdate "2001-&year;">
|
||||
<!ENTITY copyholder "The BLFS Development Team">
|
||||
<!ENTITY version "&year;-&month;-&day;">
|
||||
<!ENTITY releasedate "July 3rd, &year;">
|
||||
<!ENTITY releasedate "July 4th, &year;">
|
||||
<!ENTITY pubdate "&year;-&month;-&day;"> <!-- metadata req. by TLDP -->
|
||||
<!ENTITY blfs-version "svn"> <!-- svn|[release #] -->
|
||||
<!ENTITY lfs-version "development"> <!-- x.y|development] -->
|
||||
@ -348,6 +348,7 @@ export -f as_root</userinput></screen>
|
||||
<!ENTITY hdparm-version "9.43">
|
||||
<!ENTITY ibus-version "1.5.4"> <!-- stable lt .90 micro version -->
|
||||
<!ENTITY lm_sensors-version "3.3.5">
|
||||
<!ENTITY logrotate-version "3.8.7">
|
||||
<!ENTITY mc-version "4.8.12">
|
||||
<!ENTITY obex-data-server-version "0.4.6">
|
||||
<!ENTITY p7zip-version "9.20.1">
|
||||
|
249
general/sysutils/logrotate.xml
Normal file
249
general/sysutils/logrotate.xml
Normal file
@ -0,0 +1,249 @@
|
||||
<?xml version="1.0" encoding="ISO-8859-1"?>
|
||||
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
||||
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
||||
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
||||
%general-entities;
|
||||
|
||||
<!ENTITY logrotate-download-http "http://fedorahosted.org/releases/l/o/logrotate/logrotate-&logrotate-version;.tar.gz">
|
||||
<!ENTITY logrotate-download-ftp " ">
|
||||
<!ENTITY logrotate-md5sum "99e08503ef24c3e2e3ff74cc5f3be213">
|
||||
<!ENTITY logrotate-size "64 KB">
|
||||
<!ENTITY logrotate-buildsize "1.3 MB">
|
||||
<!ENTITY logrotate-time "less than 0.1 SBU">
|
||||
]>
|
||||
|
||||
<sect1 id="logrotate" xreflabel="logrotate-&logrotate-version;">
|
||||
<?dbhtml filename="logrotate.html"?>
|
||||
|
||||
<sect1info>
|
||||
<othername>$LastChangedBy: bdubbs $</othername>
|
||||
<date>$Date: 2014-06-15 13:40:02 -0500 (Sun, 15 Jun 2014) $</date>
|
||||
</sect1info>
|
||||
|
||||
<title>Logrotate-&logrotate-version;</title>
|
||||
|
||||
<indexterm zone="logrotate">
|
||||
<primary sortas="a-logrotate">logrotate</primary>
|
||||
</indexterm>
|
||||
|
||||
<sect2 role="package">
|
||||
<title>Introduction to Logrotate</title>
|
||||
|
||||
<para>
|
||||
The <application>logrotate</application> package allows automatic rotation,
|
||||
compression, removal, and mailing of log files.
|
||||
</para>
|
||||
|
||||
&lfs75_checked;
|
||||
|
||||
<bridgehead renderas="sect3">Package Information</bridgehead>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
Download (HTTP): <ulink url="&logrotate-download-http;"/>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Download (FTP): <ulink url="&logrotate-download-ftp;"/>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Download MD5 sum: &logrotate-md5sum;
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Download size: &logrotate-size;
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Estimated disk space required: &logrotate-buildsize;
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Estimated build time: &logrotate-time;
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
|
||||
<bridgehead renderas="sect3">Logrotate Dependencies</bridgehead>
|
||||
|
||||
<bridgehead renderas="sect4">Required</bridgehead>
|
||||
<para role="required">
|
||||
<xref linkend="popt"/>
|
||||
</para>
|
||||
|
||||
<bridgehead renderas="sect4">Recommended</bridgehead>
|
||||
<para role="recommended">
|
||||
<xref linkend="fcron"/> (runtime)
|
||||
</para>
|
||||
|
||||
<bridgehead renderas="sect4">Optional</bridgehead>
|
||||
<para role="optional">
|
||||
An <xref linkend="server-mail"/> (runtime)
|
||||
</para>
|
||||
|
||||
<para condition="html" role="usernotes">User Notes:
|
||||
<ulink url="&blfs-wiki;/logrotate"/>
|
||||
</para>
|
||||
</sect2>
|
||||
|
||||
<sect2 role="installation">
|
||||
<title>Installation of Logrotate</title>
|
||||
|
||||
<para>
|
||||
Install <application>logrotate</application> by running the following
|
||||
command:
|
||||
</para>
|
||||
|
||||
<screen><userinput>make</userinput></screen>
|
||||
|
||||
<para>
|
||||
To test the results, issue: <command>make test</command>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Now, as the <systemitem class="username">root</systemitem> user:
|
||||
</para>
|
||||
|
||||
<screen role="root"><userinput>make MANDIR=/usr/share/man install</userinput></screen>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="commands">
|
||||
<title>Command Explanations</title>
|
||||
|
||||
<para>
|
||||
<envar>MANDIR=/usr/share/man</envar>: Ensure the man pages are installed in
|
||||
the correct location.
|
||||
</para>
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="configuration">
|
||||
<title>Configuring Logrotate</title>
|
||||
|
||||
<para><application>Logrotate</application> needs a configuration file,
|
||||
which must be passed as an argument to the command when executed. Create
|
||||
the file as the <systemitem class="username">root</systemitem> user:</para>
|
||||
|
||||
<screen role="root"><userinput>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</userinput></screen>
|
||||
|
||||
<para>Now create the <filename class='directory'>/etc/logrotate.d</filename>
|
||||
directory as the <systemitem class="username">root</systemitem> user:</para>
|
||||
|
||||
<screen role="root"><userinput> mkdir -p /etc/logrotate.d</userinput></screen>
|
||||
|
||||
<para>At this point additional log rotation commands can be entered, typically
|
||||
in the <filename class='directory'>/etc/logrotate.d</filename> directory.
|
||||
For example:</para>
|
||||
|
||||
<screen role="root"><userinput>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</userinput></screen>
|
||||
|
||||
<para>See the logrotate man page or
|
||||
<ulink url='http://www.techrepublic.com/article/manage-linux-log-files-with-logrotate/'/>
|
||||
for more examples.</para>
|
||||
|
||||
<para>The command <command>logrotate /etc/logrotate.conf</command> can be
|
||||
run manually, however, the command should be run daily.
|
||||
To set up <xref linkend='fcron'/> to run at 3AM daily, root's crontab
|
||||
should be edited to add:</para>
|
||||
|
||||
<screen><literal>0 3 * * * /usr/sbin/logrotate /etc/logrotate.conf</literal></screen>
|
||||
|
||||
|
||||
</sect2>
|
||||
|
||||
<sect2 role="content">
|
||||
<title>Contents</title>
|
||||
|
||||
<segmentedlist>
|
||||
<segtitle>Installed Programs</segtitle>
|
||||
<segtitle>Installed Library</segtitle>
|
||||
<segtitle>Installed Directories</segtitle>
|
||||
|
||||
<seglistitem>
|
||||
<seg> logrotate </seg>
|
||||
<seg> None </seg>
|
||||
<seg> None </seg>
|
||||
</seglistitem>
|
||||
</segmentedlist>
|
||||
|
||||
<variablelist>
|
||||
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
||||
<?dbfo list-presentation="list"?>
|
||||
<?dbhtml list-presentation="table"?>
|
||||
|
||||
<varlistentry id="logrotate-prog">
|
||||
<term><command>logrotate</command></term>
|
||||
<listitem>
|
||||
<para>
|
||||
performs the log maintenace functions defined in the
|
||||
configuration files.
|
||||
</para>
|
||||
<indexterm zone="logrotate logrotate-prog">
|
||||
<primary sortas="b-logrotate-prog">logrotate</primary>
|
||||
</indexterm>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
|
||||
</sect2>
|
||||
|
||||
</sect1>
|
@ -31,6 +31,7 @@ $Date$
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="hdparm.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="initdtools.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="lm_sensors.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="logrotate.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="mc.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="obex-data-server.xml"/>
|
||||
<xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="p7zip.xml"/>
|
||||
|
@ -44,6 +44,16 @@
|
||||
|
||||
-->
|
||||
|
||||
<listitem>
|
||||
<para>July 4th, 2014</para>
|
||||
<itemizedlist>
|
||||
<listitem>
|
||||
<para>[bdubbs] - Add logrotate-3.8.7. Fixes
|
||||
<ulink url="&blfs-ticket-root;5229">#5229</ulink>.</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
|
||||
<listitem>
|
||||
<para>July 3rd, 2014</para>
|
||||
<itemizedlist>
|
||||
|
Loading…
Reference in New Issue
Block a user