Linux "savelog" Command Line Options and Examples
save a log file

The savelog command saves and optionally compresses old copies of files. Older versions of file are named: file.<number><compress_suffix> where <number> is the version number, 0 being the newest.


Usage:

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




Command Line Options:

-m
chmod the log files to mode, implies -t
savelog -m ...
-u
chown log files to user, implies -t
savelog -u ...
-g
chgrp log files to group, implies -t
savelog -g ...
-c
Save cycle versions of the logfile (default: 7). The cycle count must be at least 2.
savelog -c ...
-t
touch new logfile into existence
savelog -t ...
-l
don't compress any log files (default: do compress)
savelog -l ...
-p
group and permissions of logfile
savelog -p ...
-j
compress with bzip2 instead of gzip
savelog -j ...
-J
For xz no strength option is set, and xz decides on the default based on the total amount of physicalRAM. Note that xz can use a very large amount of memory for the higher compression levels.
savelog -J ...
-1
compression strength or memory usage (default: 9, except for xz)
savelog -1 ...
-C
force cleanup of cycled logfiles
savelog -C ...
-d
use standard date for rolling
savelog -d ...
-D
override date format, in the syntax understood by the date(1) command
savelog -D ...
-r
use rolldir instead of . to roll files
savelog -r ...
-n
do not rotate empty files
savelog -n ...
-q
BUGSIf a process is still writing to file.0, and savelog moves it to file.1 and compresses it, data could be lost.
savelog -q ...