savelog
(8)save a log file
Options
15-mchmod the log files to mode, implies -t
-uchown log files to user, implies -t
-gchgrp log files to group, implies -t
-cSave cycle versions of the logfile (default: 7). The cycle count must be at least 2.
-ttouch new logfile into existence
-ldon't compress any log files (default: do compress)
-ppreserve owner, group, and permissions of logfile
-jcompress with bzip2 instead of gzip
-Jcompress with xz instead of gzip For xz no strength option is set, and xz decides on the default based on the total amount of physical RAM. Note that xz can use a very large amount of memory for the higher compression levels.
-Cforce cleanup of cycled logfiles
-duse standard date for rolling
-Doverride date format, in the syntax understood by the date(1) command
-ruse rolldir instead of . to roll files
-ndo not rotate empty files
-qbe quiet
DESCRIPTION
The savelog command saves and optionally compresses old copies of files. Older versions of file are named:
file.<number><compress_suffix>
If the file does not exist and -t was given, it will be created.
For files that do exist and have lengths greater than zero, the following actions are performed:
- 1)
- Version numbered files are cycled. Version file.2 is moved to version file.3, version file.1 is moved to version file.2, and so on. Finally version file.0 is moved to version file.1, and version file is deleted. Both compressed names and uncompressed names are cycled, regardless of -l. Missing version files are ignored.
- 2)
- The new file.1 is compressed unless the -l flag was given. It is changed subject to the -m, -u, and -g flags.
- 3)
- The main file is moved to file.0.
- 4)
- If the -m, -u, -g, -t, or -p flags are given, then an empty file is created subject to the given flags. With the -p flag, the file is created with the same owner, group, and permissions as before.
- 5)
- The new file.0 is changed subject to the -m, -u, and -g flags.