version 1, including all changes.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
SAVELOG |
|
|
2 |
!!!SAVELOG |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
BUGS |
|
|
8 |
---- |
|
|
9 |
!!NAME |
|
|
10 |
|
|
|
11 |
|
|
|
12 |
savelog - save a log file |
|
|
13 |
!!SYNOPSIS |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
__savelog__ [[-m mode] [[-u user] [[-g group] [[-t] [[-p] [[-c |
|
|
17 |
cycle] [[-l] file ... |
|
|
18 |
!!DESCRIPTION |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
The __savelog__ command saves and optionally compresses |
|
|
22 |
old copies of files. Older versions of ''file'' are |
|
|
23 |
named: |
|
|
24 |
|
|
|
25 |
|
|
|
26 |
''file''.'''' |
|
|
27 |
|
|
|
28 |
|
|
|
29 |
where '''' is the version number, 0 being |
|
|
30 |
the newest. Version numbers |
|
|
31 |
''-l__ prevents it. Version number 0 is not compressed |
|
|
32 |
becase a process might still have ''file'' opened for |
|
|
33 |
I/O. Only ''cycle'' versions of the file are |
|
|
34 |
kept. |
|
|
35 |
|
|
|
36 |
|
|
|
37 |
If the file does not exist and __-t__ was given, it will |
|
|
38 |
be created. |
|
|
39 |
|
|
|
40 |
|
|
|
41 |
For files that do exist and have lengths greater than zero, |
|
|
42 |
the following actions are performed: |
|
|
43 |
|
|
|
44 |
|
|
|
45 |
1) |
|
|
46 |
|
|
|
47 |
|
|
|
48 |
Version numbered files are cycled. Version ''cycle''-2 is |
|
|
49 |
moved to version ''cycle''-1, version ''cycle''-3 is |
|
|
50 |
moved to version ''cycle''-2 , and so on. Finally version |
|
|
51 |
0 is moved to version 1, and version ''cycle'' is |
|
|
52 |
deleted. Both compressed names and uncompressed names are |
|
|
53 |
cycled, regardless of __-l__. Missing version files are |
|
|
54 |
ignored. |
|
|
55 |
|
|
|
56 |
|
|
|
57 |
2) |
|
|
58 |
|
|
|
59 |
|
|
|
60 |
The new ''file.1'' is compressed unless the __-l__ |
|
|
61 |
flag was given. It is changed subject to the __-m__, |
|
|
62 |
__-u__, and __-g__ flags. |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
3) |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
The main file is moved to ''file.0''. |
|
|
69 |
|
|
|
70 |
|
|
|
71 |
4) |
|
|
72 |
|
|
|
73 |
|
|
|
74 |
If the __-m__, __-u__, __-g__, __-t__, or |
|
|
75 |
__-p__ flags are given, then an empty ''file'' is |
|
|
76 |
created subject to the given flags. With the __-p__ flag, |
|
|
77 |
the file is created with the same owner, group, and |
|
|
78 |
permissions as before. |
|
|
79 |
|
|
|
80 |
|
|
|
81 |
5) |
|
|
82 |
|
|
|
83 |
|
|
|
84 |
The new ''file.0'' is changed subject to the __-m__, |
|
|
85 |
__-u__, and __-g__ flags. |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
Since the version numbers start with 0, version number |
|
|
89 |
''cycle'' is never formed. The ''cycle'' count must be |
|
|
90 |
at least 2. |
|
|
91 |
!!OPTIONS |
|
|
92 |
|
|
|
93 |
|
|
|
94 |
__-m mode__ |
|
|
95 |
|
|
|
96 |
|
|
|
97 |
chmod the log files to mode |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
__-u user__ |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
chown log files to user |
|
|
104 |
|
|
|
105 |
|
|
|
106 |
__-g group__ |
|
|
107 |
|
|
|
108 |
|
|
|
109 |
chgrp log files to group |
|
|
110 |
|
|
|
111 |
|
|
|
112 |
__-c cycle__ |
|
|
113 |
|
|
|
114 |
|
|
|
115 |
Save cycle versions of the logfile (default: 7) |
|
|
116 |
|
|
|
117 |
|
|
|
118 |
__-t__ |
|
|
119 |
|
|
|
120 |
|
|
|
121 |
touch new logfile into existence |
|
|
122 |
|
|
|
123 |
|
|
|
124 |
__-l__ |
|
|
125 |
|
|
|
126 |
|
|
|
127 |
don't compress any log files (default: do |
|
|
128 |
compress) |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
__-p__ |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
preserve owner, group, and permissions of |
|
|
135 |
logfile |
|
|
136 |
!!BUGS |
|
|
137 |
|
|
|
138 |
|
|
|
139 |
If a process is still writing to ''file.0'', and savelog |
|
|
140 |
moves it to ''file.1'' and compresses it, data could be |
|
|
141 |
lost. |
|
|
142 |
---- |