---
name: "logroll"
section: "1"
platform: "linux"
package: "cnews"
version: "cr.g7-31"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/logroll"
---

# logroll(1)

rename, compress, and save old log files

## NAME

logroll - rename, compress, and save old log files

## SYNOPSIS

**logroll** \[ **-o** \] \[ **-s** suffixes \] \[ **-i** initial \] \[ **-d** deleteat \] \[ **-c** compressat \] \[ **-n** notifier \] \[ **-w** compressor \] \[ **-z** compsuffix \] \[ **-p** \] logfile ...

## DESCRIPTION

*Logroll* administers saving of old log files. By default, for each *logfile*, it renames *logfile* to *logfile*.1, *logfile*.1 to *logfile*.2, and so forth, up to *logfile*.9. Files from *logfile*.3 onward are compressed to save space. Options are:

- changes the name sequence for old

  *logfile*s to run from *logfile*.o through *logfile*.ooo, with the last two compressed.

- specifies a list of

  *suffixes*, which must be in last-to-first order, with each suffix including any preceding \`.'. For example, the suffix list implied by is \`\`.ooo .oo .o'' and the default list is \`\`.9 .8 .7 .6 .5 .4 .3 .2 .1''.

- specifies an

  *initial* suffix, e.g. specifies that the name of the original *logfile* is really Default is empty.

- specifies that files beyond the suffix

  *deleteat* should be deleted rather than saved. For example, keeping only five old files could be done with but can be done more tersely with Default is the last suffix, e.g. \`\`.9'' for the default suffix list.

- specifies that files at and beyond the suffix

  *compat* should be compressed. Default is \`\`.3'' for the default suffix list and \`\`.oo'' for the list.

- specifies that when the original

  *logfile* is renamed, the command *notifier* should then be run. (The [*touch*(1)](/touch/1.md) command is used first to ensure that a (possibly-empty) new *logfile* exists after the renaming.) This allows signalling long-running processes to re-open the log file, or delaying in hopes that they will terminate. The default is \`\`sleep 5'', a 5-second delay.

- specifies the command to be used to do compression.

  Use of this option will usually require a option too. The default is \`\`compress -f''.

- specifies the suffix added to the file name by the compression program.

  The default is \`\`.Z''.

- specifies that no compression is to be done.

  ## SEE ALSO

[compress(1)](/compress/1.md), [touch(1)](/touch/1.md)

## DIAGNOSTICS

Terminates immediately with status 1 if a rename, *touch*, or compression fails.

## HISTORY

Written by Henry Spencer.

## BUGS

The default and suffix sequences are a bit arbitrary.
