"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "logrotate.8" between
logrotate-3.18.0.tar.xz and logrotate-3.18.1.tar.xz

About: logrotate rotates, compresses, and mails system logs.

logrotate.8  (logrotate-3.18.0.tar.xz):logrotate.8  (logrotate-3.18.1.tar.xz)
skipping to change at line 106 skipping to change at line 106
postrotate postrotate
/usr/bin/killall -HUP httpd /usr/bin/killall -HUP httpd
endscript endscript
} }
/var/log/news/* { /var/log/news/* {
monthly monthly
rotate 2 rotate 2
olddir /var/log/news/old olddir /var/log/news/old
missingok missingok
sharedscripts
postrotate postrotate
kill -HUP $(cat /var/run/inn.pid) kill -HUP $(cat /var/run/inn.pid)
endscript endscript
nocompress nocompress
} }
~/log/*.log {} ~/log/*.log {}
The first few lines set global options; in the example, logs are compress ed after they are rotated. Note The first few lines set global options; in the example, logs are compress ed after they are rotated. Note
that comments may appear anywhere in the config file as long as the firs t non-whitespace character on the that comments may appear anywhere in the config file as long as the firs t non-whitespace character on the
skipping to change at line 134 skipping to change at line 135
The next section defines the parameters for both /var/log/httpd/access. log and /var/log/httpd/error.log. The next section defines the parameters for both /var/log/httpd/access. log and /var/log/httpd/error.log.
Each is rotated whenever it grows over 100 kilobytes in size, and the old logs files are mailed (uncom- Each is rotated whenever it grows over 100 kilobytes in size, and the old logs files are mailed (uncom-
pressed) to recipient@example.org after going through 5 rotations, rather than being removed. The shared- pressed) to recipient@example.org after going through 5 rotations, rather than being removed. The shared-
scripts means that the postrotate script will only be run once (after the old logs have been compressed), scripts means that the postrotate script will only be run once (after the old logs have been compressed),
not once for each log which is rotated. Note that log file names ma y be enclosed in quotes (and that not once for each log which is rotated. Note that log file names ma y be enclosed in quotes (and that
quotes are required if the name contains spaces). Normal shell quoting r ules apply, with ', ", and \ quotes are required if the name contains spaces). Normal shell quoting r ules apply, with ', ", and \
characters supported. characters supported.
The next section defines the parameters for all of the files in /var/lo g/news. Each file is rotated on a The next section defines the parameters for all of the files in /var/lo g/news. Each file is rotated on a
monthly basis. This is considered a single rotation directive and if err monthly basis.
ors occur for more than one file,
the log files are not compressed.
The last section uses tilde expansion to rotate log files in the home dir ectory of the current user. This The last section uses tilde expansion to rotate log files in the home dir ectory of the current user. This
is only available, if your glob library supports tilde expansion. GNU gl ob does support this. is only available, if your glob library supports tilde expansion. GNU gl ob does support this.
Please use wildcards with caution. If you specify *, logrotate will rota Please use wildcards with caution. If you specify *, logrotate will r
te all files, including previ- otate all files, including previ-
ously rotated ones. A way around this is to use the olddir directive ously rotated ones. A way around this is to use the olddir directive or
or a more exact wildcard (such as a more exact wildcard (such as
*.log). *.log).
Here is more information on the directives which may be included in a log rotate configuration file: Here is more information on the directives which may be included in a log rotate configuration file:
CONFIGURATION FILE DIRECTIVES CONFIGURATION FILE DIRECTIVES
These directives may be included in a logrotate configuration file: These directives may be included in a logrotate configuration file:
Rotation Rotation
rotate count rotate count
Log files are rotated count times before being removed or mailed t o the address specified in a mail Log files are rotated count times before being removed or mailed t o the address specified in a mail
directive. If count is 0, old versions are removed rather than r otated. If count is -1, old logs directive. If count is 0, old versions are removed rather than ro tated. If count is -1, old logs
are not removed at all, except they are affected by maxage (use wi th caution, may waste performance are not removed at all, except they are affected by maxage (use wi th caution, may waste performance
and disk space). Default is 0. and disk space). Default is 0.
olddir directory olddir directory
Logs are moved into directory for rotation. The directory must Logs are moved into directory for rotation. The directory must be
be on the same physical device as on the same physical device as
the log file being rotated, unless copy, copytruncate or renamecop the log file being rotated, unless copy, copytruncate or renameco
y option is used. The directory py option is used. The directory
is assumed to be relative to the directory holding the log fil is assumed to be relative to the directory holding the log file un
e unless an absolute path name is less an absolute path name is
specified. When this option is used all old versions of the log e specified. When this option is used all old versions of the log
nd up in directory. This option end up in directory. This option
may be overridden by the noolddir option. may be overridden by the noolddir option.
noolddir noolddir
Logs are rotated in the directory they normally reside in (this ov errides the olddir option). Logs are rotated in the directory they normally reside in (this ov errides the olddir option).
su user group su user group
Rotate log files set under this user and group instead of using d Rotate log files set under this user and group instead of using de
efault user/group (usually root). fault user/group (usually root).
user specifies the user used for rotation and group specifies the user specifies the user used for rotation and group specifies the
group used for rotation (see the group used for rotation (see the
section USER AND GROUP for details). If the user/group you spec section USER AND GROUP for details). If the user/group you specif
ify here does not have sufficient y here does not have sufficient
privilege to make files with the ownership you've specified in a c reate directive, it will cause an privilege to make files with the ownership you've specified in a c reate directive, it will cause an
error. If logrotate runs with root privileges, it is recommended to use the su directive to rotate error. If logrotate runs with root privileges, it is recommended to use the su directive to rotate
files in directories that are directly or indirectly in control of non-privileged users. files in directories that are directly or indirectly in control of non-privileged users.
Frequency Frequency
hourly Log files are rotated every hour. Note that usually logrotate is hourly Log files are rotated every hour. Note that usually logrotat
configured to be run by cron e is configured to be run by cron
daily. You have to change this configuration and run logrotate h daily. You have to change this configuration and run logrotate ho
ourly to be able to really rotate urly to be able to really rotate
logs hourly. logs hourly.
daily Log files are rotated every day. daily Log files are rotated every day.
weekly [weekday] weekly [weekday]
Log files are rotated once each weekday, or if the date is advance Log files are rotated once each weekday, or if the date is adva
d by at least 7 days since the nced by at least 7 days since the
last rotation (while ignoring the exact time). The weekday int last rotation (while ignoring the exact time). The weekday interp
erpretation is following: 0 means retation is following: 0 means
Sunday, 1 means Monday, ..., 6 means Saturday; the special value 7 Sunday, 1 means Monday, ..., 6 means Saturday; the special val
means each 7 days, irrespec- ue 7 means each 7 days, irrespec-
tively of weekday. Defaults to 0 if the weekday argument is omitt ed. tively of weekday. Defaults to 0 if the weekday argument is omitt ed.
monthly monthly
Log files are rotated the first time logrotate is run in a month ( this is normally on the first day Log files are rotated the first time logrotate is run in a month ( this is normally on the first day
of the month). of the month).
yearly Log files are rotated if the current year is not the same as the l ast rotation. yearly Log files are rotated if the current year is not the same as the l ast rotation.
size size size size
Log files are rotated only if they grow bigger than size bytes. I f size is followed by k, the size Log files are rotated only if they grow bigger than size bytes. I f size is followed by k, the size
is assumed to be in kilobytes. If the M is used, the size is in is assumed to be in kilobytes. If the M is used, the size is in m
megabytes, and if G is used, the egabytes, and if G is used, the
size is in gigabytes. So size 100, size 100k, size 100M and size 1 size is in gigabytes. So size 100, size 100k, size 100M and size
00G are all valid. This option 100G are all valid. This option
is mutually exclusive with the time interval options, and it cause s log files to be rotated without is mutually exclusive with the time interval options, and it cause s log files to be rotated without
regard for the last rotation time, if specified after the time cri teria (the last specified option regard for the last rotation time, if specified after the time cr iteria (the last specified option
takes the precedence). takes the precedence).
File selection File selection
missingok missingok
If the log file is missing, go on to the next one without is suing an error message. See also If the log file is missing, go on to the next one without issuing an error message. See also
nomissingok. nomissingok.
nomissingok nomissingok
If a log file does not exist, issue an error. This is the default . If a log file does not exist, issue an error. This is the default .
ifempty ifempty
Rotate the log file even if it is empty, overriding the notifempty option (ifempty is the default). Rotate the log file even if it is empty, overriding the notifempty option (ifempty is the default).
notifempty notifempty
Do not rotate the log if it is empty (this overrides the ifempty o ption). Do not rotate the log if it is empty (this overrides the ifempty o ption).
minage count minage count
Do not rotate logs which are less than <count> days old. Do not rotate logs which are less than <count> days old.
maxage count maxage count
Remove rotated logs older than <count> days. The age is only chec Remove rotated logs older than <count> days. The age is onl
ked if the logfile is to be y checked if the logfile is to be
rotated. rotate -1 does not hinder removal. The files are ma rotated. rotate -1 does not hinder removal. The files are mailed
iled to the configured address if to the configured address if
maillast and mail are configured. maillast and mail are configured.
minsize size minsize size
Log files are rotated when they grow bigger than size bytes, but n ot before the additionally speci- Log files are rotated when they grow bigger than size bytes, but n ot before the additionally speci-
fied time interval (daily, weekly, monthly, or yearly). The rela ted size option is similar except fied time interval (daily, weekly, monthly, or yearly). The relat ed size option is similar except
that it is mutually exclusive with the time interval options, and it causes log files to be rotated that it is mutually exclusive with the time interval options, and it causes log files to be rotated
without regard for the last rotation time, if specified after the time criteria (the last specified without regard for the last rotation time, if specified after the time criteria (the last specified
option takes the precedence). When minsize is used, both the size and timestamp of a log file are option takes the precedence). When minsize is used, both the siz e and timestamp of a log file are
considered. considered.
maxsize size maxsize size
Log files are rotated when they grow bigger than size bytes even Log files are rotated when they grow bigger than size bytes even b
before the additionally specified efore the additionally specified
time interval (daily, weekly, monthly, or yearly). The related si time interval (daily, weekly, monthly, or yearly). The related s
ze option is similar except that ize option is similar except that
it is mutually exclusive with the time interval options, and it is mutually exclusive with the time interval options, and it ca
it causes log files to be rotated uses log files to be rotated
without regard for the last rotation time, if specified after the time criteria (the last specified without regard for the last rotation time, if specified after the time criteria (the last specified
option takes the precedence). When maxsize is used, both the siz e and timestamp of a log file are option takes the precedence). When maxsize is used, both the size and timestamp of a log file are
considered. considered.
tabooext [+] list tabooext [+] list
The current taboo extension list is changed (see the include direc tive for information on the taboo The current taboo extension list is changed (see the include direc tive for information on the taboo
extensions). If a + precedes the list of extensions, the cur extensions). If a + precedes the list of extensions, the current
rent taboo extension list is aug- taboo extension list is aug-
mented, otherwise it is replaced. At startup, the taboo extension mented, otherwise it is replaced. At startup, the taboo extens
list ,v, .cfsaved, .disabled, ion list ,v, .cfsaved, .disabled,
.dpkg-bak, .dpkg-del, .dpkg-dist, .dpkg-new, .dpkg-old, .rhn-cf .dpkg-bak, .dpkg-del, .dpkg-dist, .dpkg-new, .dpkg-old, .rhn-cfg-t
g-tmp-*, .rpmnew, .rpmorig, .rpm- mp-*, .rpmnew, .rpmorig, .rpm-
save, .swp, .ucf-dist, .ucf-new, .ucf-old, ~ save, .swp, .ucf-dist, .ucf-new, .ucf-old, ~
taboopat [+] list taboopat [+] list
The current taboo glob pattern list is changed (see the include di The current taboo glob pattern list is changed (see the include
rective for information on the directive for information on the
taboo extensions and patterns). If a + precedes the list of pa taboo extensions and patterns). If a + precedes the list of patte
tterns, the current taboo pattern rns, the current taboo pattern
list is augmented, otherwise it is replaced. At startup, the tabo o pattern list is empty. list is augmented, otherwise it is replaced. At startup, the tabo o pattern list is empty.
Files and Folders Files and Folders
create mode owner group, create owner group create mode owner group, create owner group
Immediately after rotation (before the postrotate script is run) t Immediately after rotation (before the postrotate script is run)
he log file is created (with the the log file is created (with the
same name as the log file just rotated). mode specifies the mo same name as the log file just rotated). mode specifies the mode
de for the log file in octal (the for the log file in octal (the
same as chmod(2)), owner specifies the user who will own the log same as chmod(2)), owner specifies the user who will own the
file, and group specifies the log file, and group specifies the
group the log file will belong to (see the section USER AND GR group the log file will belong to (see the section USER AND GROUP
OUP for details). Any of the log for details). Any of the log
file attributes may be omitted, in which case those attributes for file attributes may be omitted, in which case those attributes f
the new file will use the same or the new file will use the same
values as the original log file for the omitted attributes. This values as the original log file for the omitted attributes. This
option can be disabled using the option can be disabled using the
nocreate option. nocreate option.
nocreate nocreate
New log files are not created (this overrides the create option). New log files are not created (this overrides the create option).
createolddir mode owner group createolddir mode owner group
If the directory specified by olddir directive does not exist, it If the directory specified by olddir directive does not exist,
is created. mode specifies the it is created. mode specifies the
mode for the olddir directory in octal (the same as chmod(2)), mode for the olddir directory in octal (the same as chmod(2)), own
owner specifies the user who will er specifies the user who will
own the olddir directory, and group specifies the group the olddir own the olddir directory, and group specifies the group the old
directory will belong to (see dir directory will belong to (see
the section USER AND GROUP the section USER AND GROUP
for details). This option can be disabled using the nocreateoldd ir option. for details). This option can be disabled using the nocreateoldd ir option.
nocreateolddir nocreateolddir
olddir directory is not created by logrotate when it does not exis t. olddir directory is not created by logrotate when it does not exis t.
copy Make a copy of the log file, but don't change the original at a copy Make a copy of the log file, but don't change the original at all.
ll. This option can be used, for This option can be used, for
instance, to make a snapshot of the current log file, or when some instance, to make a snapshot of the current log file, or when som
other utility needs to truncate e other utility needs to truncate
or parse the file. When this option is used, the create option wi ll have no effect, as the old log or parse the file. When this option is used, the create option wi ll have no effect, as the old log
file stays in place. file stays in place. The copy option allows storing rotated l
og files on the different devices
using olddir directive.
nocopy Do not copy the original log file and leave it in place. (this ov errides the copy option). nocopy Do not copy the original log file and leave it in place. (this ov errides the copy option).
copytruncate copytruncate
Truncate the original log file to zero size in place after creatin g a copy, instead of moving the Truncate the original log file to zero size in place after creatin g a copy, instead of moving the
old log file and optionally creating a new one. It can be used wh en some program cannot be told to old log file and optionally creating a new one. It can be used wh en some program cannot be told to
close its logfile and thus might continue writing (appending) to t he previous log file forever. close its logfile and thus might continue writing (appending) to t he previous log file forever.
Note that there is a very small time slice between copying the fil e and truncating it, so some log- Note that there is a very small time slice between copying the fil e and truncating it, so some log-
ging data might be lost. When this option is used, the create opt ion will have no effect, as the ging data might be lost. When this option is used, the create opt ion will have no effect, as the
old log file stays in place. old log file stays in place. The copytruncate option allows stor
ing rotated log files on the dif-
ferent devices using olddir directive. The copytruncate option im
plies norenamecopy.
nocopytruncate nocopytruncate
Do not truncate the original log file in place after creating a c opy (this overrides the copytrun- Do not truncate the original log file in place after creating a co py (this overrides the copytrun-
cate option). cate option).
renamecopy renamecopy
Log file is renamed to temporary filename in the same directory by Log file is renamed to temporary filename in the same directory
adding ".tmp" extension to it. by adding ".tmp" extension to it.
After that, postrotate script is run and log file is copied from After that, postrotate script is run and log file is copied from t
temporary filename to final file- emporary filename to final file-
name. This allows storing rotated log files on the different devi name. In the end, temporary filename is removed. The renamecopy
ces using olddir directive. In option allows storing rotated log
the end, temporary filename is removed. files on the different devices using olddir directive. The rename
copy option implies nocopytrun-
cate.
norenamecopy
Do not rename and copy the original log file (this overrides the r
enamecopy option).
shred Delete log files using shred -u instead of unlink(). This should ensure that logs are not readable shred Delete log files using shred -u instead of unlink(). This should ensure that logs are not readable
after their scheduled deletion; this is off by default. See also noshred. after their scheduled deletion; this is off by default. See also noshred.
noshred noshred
Do not use shred when deleting old log files. See also shred. Do not use shred when deleting old log files. See also shred.
shredcycles count shredcycles count
Asks GNU shred(1) to overwrite log files count times before deleti on. Without this option, shred's Asks GNU shred(1) to overwrite log files count times before deleti on. Without this option, shred's
default will be used. default will be used.
skipping to change at line 495 skipping to change at line 501
SEE ALSO SEE ALSO
chmod(2), gunzip(1), gzip(1), mail(1), shred(1), strftime(3), strtou l(3), <https://github.com/logro- chmod(2), gunzip(1), gzip(1), mail(1), shred(1), strftime(3), strtou l(3), <https://github.com/logro-
tate/logrotate> tate/logrotate>
AUTHORS AUTHORS
Erik Troan, Preston Brown, Jan Kaluza. Erik Troan, Preston Brown, Jan Kaluza.
<https://github.com/logrotate/logrotate> <https://github.com/logrotate/logrotate>
Linux 3.18.0 LOGROTATE(8) Linux 3.18.1 LOGROTATE(8)
 End of changes. 26 change blocks. 
93 lines changed or deleted 103 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)