ROTATE(1) BSD Reference Manual ROTATE(1)NAMErotate - rotate log files into a number of archives
SYNOPSISrotate [-c | -z] [-m mode] [-o owner] [-r rot] [-s] file [suffix ...]
DESCRIPTION
The rotate program is used to rotate log files for archival purposes.
The suffix arguments are arbitrary, you can use any valid file characters
or you can use the -r argument. Logs are rotated right-to-left so the
current log file is rotated into the last file.suffix argument. The
jot(1) program may be used to generate more complex lists of suffixes.
The following options are available:
-c Compress the archive with compress.
-m mode Set the file modes to mode. Mode can be any valid Chmod(1)
mode argument. Defaults to 0644.
-o owner Set the file owner and/or group, the argument is passed to
chown(8).
-r rot Rotate into archives numbered 0 through rot. Rot must be
greater than or equal to 0.
-s Enable running a file.scan program after log rotation but be-
fore compression. The file.scan program is passed the most
recent archive and the actual log file as arguments:
file.scan file.suffix file
This feature can be used to process log data and set file
permissions. However, you must be careful not to allow users
to write file.scan files that are being run as root.
-z Compress the archive with gzip.
EXAMPLES
Save 10 archives (0-9) specifying the suffixes manually:
% rotate /path/file 9 8 7 6 5 4 3 2 1 0
Save 10 archives (0-9):
% rotate-r 9 /path/file
Compress archives with gzip:
% rotate-r 9 -z /path/file
Set owner, group, and file modes on the newly created archive file:
% rotate-m 0600 -o root:wheel -r 9 /path/file
SEE ALSOchmod(1), chown(8), jot(1)HISTORY
This rotate command was written for BSD/OS 3.0.
BSDI BSD/OS November 5, 1996 1