savelog - cycle and truncate log files
command renames and optionally compresses a log file and cycles it
through a set of names based on the original log file, removing the
last name in the cycle.
command accepts the following options:
- -m mode
- Change the permissions mode for renamed log files to
By default the mode is unchanged.
- -u user
- Change the owner for renamed log files to
By default the owner is unchanged.
- -g group
- Change the group for renamed log files to
By default the group is unchanged.
- -c cycle
versions of the logfile, where
is a decimal number. The default value is 7.
- Do not compress log files. By default, a compression program is used,
if one is available.
- Ensure that a new logfile exists when the savelog operation is
complete. Use of
imply this, ensuring that the logfile will have the designated mode.
The given logfile is cycled through files named:
is the basename for the logfile and where
ranges from 0 to one less then the
count specified for the command.
dirctory is created, as necessary, and is under the same directory as
the logfile itself.
This cycle operation is accomplished by renaming the file numbered
to a file numbered
and so on until the file numbered 0 is renamed to the file numbered 1.
If compression is being used, the first cycle file is compressed after
being renamed to cycle 1. After the cycle files are moved through the
various names, the filefile itself is moved to the cycle 0 file.
This cycle normally occurs once every time
If the log file does not exist, savelog ignores it and does
not cycle the OLD files.
If compression is being used, then compressed log files will have an
additional suffix appropriate for the compression program that is
Copyright(C)1987, 1988 Ronald S. Karr and Landon Curt Noll
See a file COPYING,
distributed with the source code,
for distribution rights and restrictions
associated with this software.