


SAVELOG(8)                                             SAVELOG(8)


NAME
       savelog - cycle and truncate log files

SYNOPSIS
       /usr/lib/mail/savelog [ -m mode ] [ -u user ] [ -g group ]
       [ -c cycle ] [ -t ] [ -l ] logfile

DESCRIPTION
       The savelog 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.

OPTIONS
       The savelog command accepts the following options:

       -m mode
              Change the permissions mode for renamed  log  files
              to mode.  By default the mode is unchanged.

       -u user
              Change the owner for renamed log files to user.  By
              default the owner is unchanged.

       -g group
              Change the group for renamed log  files  to  group.
              By default the group is unchanged.

       -c cycle
              Save  cycle versions of the logfile, where cycle is
              a decimal number.  The default value is 7.

       -l     Do not compress log files.  By default, a  compres-
              sion program is used, if one is available.

       -t     Ensure  that  a new logfile exists when the savelog
              operation is complete.  Use of -m, -u or  -g  imply
              this,  ensuring that the logfile will have the des-
              ignated mode.

OPERATION
       The given logfile is cycled through files named:

              OLD/file.number

       where file is the basename for the logfile and where  num-
       ber  ranges from 0 to one less then the cycle count speci-
       fied for the command.  The OLD  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  cycle-2  to  a  file  numbered cycle-1 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



Local                    31 January 1988                        1





SAVELOG(8)                                             SAVELOG(8)


       compressed after being renamed  to  cycle  1.   After  the
       cycle files are moved through the various names, the file-
       file itself is moved to the cycle 0 file.  This cycle nor-
       mally  occurs once every time savelog is executed.  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  com-
       pression program that is used.

SEE ALSO
       smail(5) and smail(8).

COPYRIGHT
       Copyright(C)1987, 1988 Ronald S. Karr and Landon Curt Noll
       Copyright(C)1992 Ronald S. Karr
       See a file COPYING, distributed with the source  code,  or
       type  smail  -bc  for distribution rights and restrictions
       associated with this software.





































Local                    31 January 1988                        2


