OS Manuals

/usr/bin/rotatelogs

Apache HTTP Server (utilities)

From apache2-utils 2.4.70-r0 (os), captured 2026-11-07 by running rotatelogs --help (exit 1). permalink

Incorrect number of arguments
Usage: /usr/bin/rotatelogs [-vlfDtTec] [-L linkname] [-p prog] [-n number] <logfile> {<rotation time in seconds>|<rotation size>(B|K|M|G)} [offset minutes from UTC]

Add this:

TransferLog "|/usr/bin/rotatelogs /some/where 86400"

or

TransferLog "|/usr/bin/rotatelogs /some/where 5M"

to httpd.conf. By default, the generated name will be
<logfile>.nnnn where nnnn is the system time at which the log
nominally starts (N.B. if using a rotation time, the time will
always be a multiple of the rotation time, so you can synchronize
cron scripts with it). If <logfile> contains strftime conversion
specifications, those will be used instead. At the end of each
rotation time or when the file size is reached a new log is
started.

Options:
  -v       Verbose operation. Messages are written to stderr.
  -l       Base rotation on local time instead of UTC.
  -L path  Create hard link from current log to specified path.
  -p prog  Run specified program after opening a new log file. See below.
  -f       Force opening of log on program start.
  -D       Create parent directories of log file.
  -t       Truncate logfile instead of rotating, tail friendly.
  -T       Truncate logfiles opened for rotation, but not the initial logfile.
  -e       Echo log to stdout for further processing.
  -c       Create log even if it is empty.
  -n num   Rotate file by adding suffixes '.1', '.2', ..., '.num'.

The program for '-p' is invoked as "[prog] <curfile> [<prevfile>]"
where <curfile> is the filename of the newly opened logfile, and
<prevfile>, if given, is the filename of the previously used logfile.
Options (11)
OptionDescriptionSource
-vProduce verbose output on STDERR.help + man
-lCauses the use of local time rather than GMT as the base for the interval or for strftime(3) formatting with size-based rotation.help + man
-L pathCreate hard link from current log to specified path.help + man
-p progIf given, rotatelogs will execute the specified program every time a new log file is opened.help + man
-fCauses the logfile to be opened immediately, as soon as rotatelogs starts, instead of waiting for the first logfile entry to be read (for non-busy sites, there may be a substantial delay between when…help + man
-DCreates the parent directories of the path that the log file will be placed in if they do not already exist.help + man
-tCauses the logfile to be truncated instead of rotated.help + man
-TTruncate logfiles opened for rotation, but not the initial logfile.help + man
-eEcho log to stdout for further processing.help + man
-cCreate log file for each interval, even if empty.help + man
-n numRotate file by adding suffixes '.1', '.2', ..., '.num'.help + man
Examples (6) from the manual page, untested

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.