Content-type: text/html Man page of SAVELOG


Section: Maintenance Commands (8)
Updated: 1 May 2009
Index Return to Main Contents


savelog - save a log file  


savelog [-m mode] [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-C] [-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat] file ...  


The savelog command saves and optionally compresses old copies of files. Older versions of file are named:


where <number> is the version number, 0 being the newest. Version numbers > 0 are compressed unless -l prevents it. Version number 0 is not compressed because a process might still have file opened for I/O. Only cycle versions of the file are kept.

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:

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.

The new file.1 is compressed unless the -l flag was given. It is changed subject to the -m, -u, and -g flags.

The main file is moved to file.0.

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.

The new file.0 is changed subject to the -m, -u, and -g flags.



-m mode
chmod the log files to mode, implies -t
-u user
chown log files to user, implies -t
-g group
chgrp log files to group, implies -t
-c cycle
Save cycle versions of the logfile (default: 7). The cycle count must be at least 2.
touch new logfile into existence
don't compress any log files (default: do compress)
preserve owner, group, and permissions of logfile
compress with bzip2 instead of gzip
force cleanup of cycled logfiles
use standard date for rolling
-D dateformat
override date format, in the form of [MMDDhhmm[[CC]YY][.ss]]
use rolldir instead of . to roll files
do not rotate empty files
be quiet


If a process is still writing to file.0, and savelog moves it to file.1 and compresses it, data could be lost.




This document was created by man2html, using the manual pages.
Time: 04:17:50 GMT, September 24, 2010